com.berryworks.edireader
Class AnsiReader

java.lang.Object
  extended by com.berryworks.edireader.EDIAbstractReader
      extended by com.berryworks.edireader.EDIReader
          extended by com.berryworks.edireader.StandardReader
              extended by com.berryworks.edireader.AnsiReader
All Implemented Interfaces:
com.berryworks.edireader.error.ErrorMessages, org.xml.sax.XMLReader

public class AnsiReader
extends StandardReader

Reads and parses ANSI X.12 EDI interchanges. This class is not normally constructed explicitly from outside the package, although it is declared public for special cases. The recommended use of this class is to first establish an EDIReader using one of the factory techniques; when the EDIReader is called upon to parse the EDI data, it determines which EDI standard applies and internally constructs the proper subclass to continue with parsing.


Field Summary
 
Fields inherited from class com.berryworks.edireader.EDIReader
debug
 
Fields inherited from interface com.berryworks.edireader.error.ErrorMessages
CONTROL_NUMBER_GE, CONTROL_NUMBER_IEA, CONTROL_NUMBER_SE, CONTROL_NUMBER_UNT, CONTROL_NUMBER_UNZ, COUNT_GE, COUNT_IEA, COUNT_SE, COUNT_UNT, COUNT_UNZ, DIGITS_ONLY, ELEMENT_TOO_LONG, EXPECTED_SIMPLE_TOKEN, FIRST_SEGMENT_MUST_BE_UNA_OR_UNB, INCOMPLETE_ACH_MESSAGE, INCOMPLETE_HL7_MESSAGE, INCOMPLETE_X12, INTERNAL_ERROR_MULTIPLE_EOFS, INTERNAL_ERROR_MULTIPLE_PREVIEWS, INVALID_BEGINNING_OF_SEGMENT, INVALID_COMPOSITE, INVALID_SEGMENT_TERMINATOR, INVALID_UNA, ISA_FIELD_WIDTH, ISA_SEGMENT_HAS_TOO_FEW_FIELDS, MALFORMED_EDI_SEGMENT, MANDATORY_ELEMENT_MISSING, MISMATCHED_PACKAGE_REF, MISMATCHED_UNP_LENGTH, MISSING_UNO_LENGTH, MISSING_UNP, NO_HL7_PARSER, NO_STANDARD_BEGINS_WITH, TOO_MANY_ISA_FIELDS, UNEXPECTED_EOF, UNEXPECTED_SEGMENT_IN_CONTEXT, X12_MISSING_ISA
 
Constructor Summary
AnsiReader()
           
 
Method Summary
 ReplyGenerator getAckGenerator()
           
 void preview()
          Preview the ANSI X.12 input before attempting to tokenize it in order to discover syntactic details including segment terminator and field delimiter.
 
Methods inherited from class com.berryworks.edireader.StandardReader
getDocumentCount, getGroupControlNumber, getGroupCount, getInterchangeControlNumber, getSyntaxException, parse, setAckGenerator, setControlDateAndTime, setDocumentCount, setGroupControlNumber, setGroupCount, setInterchangeControlNumber, setSyntaxException
 
Methods inherited from class com.berryworks.edireader.EDIReader
getXMLTags, setDebug, setXMLTags
 
Methods inherited from class com.berryworks.edireader.EDIAbstractReader
emptyStringIfNull, getAcknowledgmentSyntaxDescriptor, getAckStream, getCharCount, getContentHandler, getDecimalMark, getDelimiter, getDocumentAttributes, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getFirstSegment, getGroupAttributes, getInterchangeAttributes, getProperty, getRelease, getReleaseCharacter, getRepetitionSeparator, getSegmentCharCount, getSubDelimiter, getSubSubDelimiter, getSyntaxExceptionHandler, getTerminator, getTerminatorSuffix, getTokenizer, getTransactionCallback, isExternalXmlDocumentStart, isInterchangeAcknowledgment, isNamespaceEnabled, isPresent, isPreviewed, isReleaseCharacterDefined, parse, setAcknowledgment, setAcknowledgment, setAcknowledgmentSyntaxDescriptor, setAckStream, setContentHandler, setCopyWriter, setDecimalMark, setDelimiter, setDTDHandler, setEntityResolver, setErrorHandler, setExternalXmlDocumentStart, setFeature, setFirstSegment, setInterchangeAcknowledgment, setLocale, setNamespaceEnabled, setPreviewed, setProperty, setRelease, setRepetitionSeparator, setSubDelimiter, setSubSubDelimiter, setSyntaxExceptionHandler, setTerminator, setTerminatorSuffix, setTokenizer, setTransactionCallback, toString, trace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnsiReader

public AnsiReader()
Method Detail

preview

public void preview()
             throws EDISyntaxException,
                    java.io.IOException
Preview the ANSI X.12 input before attempting to tokenize it in order to discover syntactic details including segment terminator and field delimiter. Upon return, the input stream has been re-positioned so that the tokenizer can read from the beginning of the interchange.

Overrides:
preview in class EDIReader
Throws:
EDISyntaxException - if invalid EDI is detected
java.io.IOException - for problem reading EDI data

getAckGenerator

public ReplyGenerator getAckGenerator()
Overrides:
getAckGenerator in class StandardReader