Re: [Servingxml-help] header content
Brought to you by:
danielaparker
From: Daniel P. <dan...@sy...> - 2007-04-05 01:32:51
|
Currently, you only have one option to examine the values of specific = fields in the header or trailer records as they are read. That is to = use a sx:flatFileSignature element, with recordType=3D<record type name = of a header or trailer record>, field=3D<field name in the header or = trailer record>, custom=3D"yes", class=3D<implementation of = com.servingxml.components.recordio.flatfile.SignatureMethod>, and = validate=3D"yes". Your implementation would look like public class MySignatureMethod implements SignatureMethod { private Value expectedValue; public void data(byte[] bytes, int start, int length) throws ServingXmlException { // Do nothing } public void validate(Value expectedValue) throws ServingXmlException { this.expectedValue =3D expectedValue; // This is the value for the header/trailer field. Your only real = option at this // point is to throw an exception if you don't like it } public Value getSignature() { return expectedValue; } } Check the element reference on sx:flatFileSignature, and the javadocs = for SignatureMethod. -- Daniel ----- Original Message -----=20 From: Ravikumar Tadysetty=20 To: Daniel Parker=20 Sent: Wednesday, April 04, 2007 3:12 PM Subject: [Servingxml-help] header content Hi I am using sx:flatfileheader to indicate a header record of a flat = file. How can I examine the contents of this record in Java code. via = RecordFilter or some other means. Thanks Ravi -------------------------------------------------------------------------= ----- = -------------------------------------------------------------------------= Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to = share your opinions on IT & business topics through brief surveys-and earn cash = http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV -------------------------------------------------------------------------= ----- _______________________________________________ Servingxml-help mailing list Ser...@li... https://lists.sourceforge.net/lists/listinfo/servingxml-help |