|
Open Business Objects for EDI v3.5.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.americancoders.edi.ValidXMLEDIParser
class builds OBOE objects by parsing input string in valid xml edi format
OBOE - Open Business Objects for EDI
Part of the OBOE Basic Extended Package
An EDI and XML Translator Written In Java
Copyright 1998-2007 - American Coders, LTD - Raleigh NC USA
All rights reserved
American Coders, Ltd
P. O. Box 97462
Raleigh, NC 27624 USA
1-919-846-2014
http://www.americancoders.com
| Field Summary | |
protected int |
_iElement
current element position |
protected int |
_iLine
current line number |
protected CompositeDE |
composite
cucurrent comp |
protected ICompositeDEContainer |
compositeContainer
current composite container |
protected java.io.CharArrayWriter |
contents
simple string processor |
protected Table |
detailTable
current detail tlb |
protected DataElement |
element
current element |
protected IDataElementContainer |
elementContainer
current de container |
protected int |
elementCount
# of elements found |
protected Table |
headerTable
current header tbl |
protected Loop |
loop
current loop |
protected LoopAndSegmentContainer |
loopAndSegmentContainer
current loop container, either table or loop |
protected java.util.Stack |
loopAndSegmentStack
stack to handle recursive nature of file |
protected Envelope |
parsedEnvelope
envelope |
protected FunctionalGroup |
parsedFunctionalGroup
functionalGroup |
protected TemplateTransactionSet |
parsedTemplateTransactionSet
templatetransactionset |
protected TransactionSet |
parsedTransactionSet
transactionset |
protected javax.xml.parsers.SAXParser |
parser
parser object |
protected Segment |
segment
current seg |
protected SegmentContainer |
segmentContainer
current seg container, either table or loop |
protected Table |
summaryTable
current sum table |
protected Table |
table
current table |
protected TemplateComposite |
templateComposite
|
protected TemplateSegment |
templateSegment
|
protected TemplateTable |
templateTable
current template table |
protected java.lang.String |
xmlDirectoryPath
|
| Constructor Summary | |
ValidXMLEDIParser()
create a XML EDI parser for valid xml files |
|
| Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Method handles #PCDATA |
void |
comment(char[] chars,
int start,
int length)
|
void |
endCDATA()
|
void |
endDTD()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
Method called by the SAX parser at the |
void |
endEntity(java.lang.String arg0)
|
void |
error(org.xml.sax.SAXParseException e)
catches error SAXParseExceptions this code causes exception to continue |
void |
fatalError(org.xml.sax.SAXParseException e)
catches fatal SAXParseExceptions this code causes exception to continue |
Envelope |
getEnvelope()
returns the envelope that was parsed |
TransactionSet |
getTransactionSet()
returns the last transaction set that was parsed |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
I use this to keep track of line #s |
static void |
main(java.lang.String[] args)
static main method to test xmlparser class |
void |
parse(java.lang.String text)
parse an xml document coming in as a String |
void |
parseFile(java.lang.String filename)
parse an xml |
org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
resolves the DTD file name for the xml parser |
void |
startCDATA()
|
void |
startDTD(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
org.xml.sax.Attributes attributes)
method called for each xml element found. |
void |
startEntity(java.lang.String arg0)
|
void |
warning(org.xml.sax.SAXParseException e)
catches warning SAXParseExceptions this code sends exception to stdio and allows public classto continue |
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endDocument, endPrefixMapping, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Envelope parsedEnvelope
protected FunctionalGroup parsedFunctionalGroup
protected TransactionSet parsedTransactionSet
protected TemplateTransactionSet parsedTemplateTransactionSet
protected int _iElement
protected int _iLine
protected Table table
protected TemplateTable templateTable
protected Table headerTable
protected Table detailTable
protected Table summaryTable
protected Loop loop
protected Segment segment
protected CompositeDE composite
protected DataElement element
protected LoopAndSegmentContainer loopAndSegmentContainer
protected SegmentContainer segmentContainer
protected ICompositeDEContainer compositeContainer
protected IDataElementContainer elementContainer
protected java.util.Stack loopAndSegmentStack
protected int elementCount
protected java.io.CharArrayWriter contents
protected javax.xml.parsers.SAXParser parser
protected TemplateSegment templateSegment
protected TemplateComposite templateComposite
protected java.lang.String xmlDirectoryPath
| Constructor Detail |
public ValidXMLEDIParser()
| Method Detail |
public void parse(java.lang.String text)
throws org.xml.sax.SAXException,
java.io.FileNotFoundException,
java.io.IOException
text - String xml data
org.xml.sax.SAXException
java.io.FileNotFoundException
java.io.IOException
public void parseFile(java.lang.String filename)
throws org.xml.sax.SAXException,
java.io.FileNotFoundException,
java.io.IOException
filename - String xml file name
org.xml.sax.SAXException
java.io.FileNotFoundException
java.io.IOException
public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException
resolveEntity in interface org.xml.sax.EntityResolverpublicId - - String name of xml public idsystemId - - String name of xml system id
org.xml.sax.SAXException
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandleruri - URI of incoming filelocalName - String of element's local namerawName - String of element's raw nameattributes - Vector of the elements attributes
org.xml.sax.SAXException - many possible exceptions
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String rawName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandleruri - URI of incoming filelocalName - String of element's local namerawName - String of element's raw name
org.xml.sax.SAXException - many possible *
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlerch - arraystart - position in array where next has been placedlength - int
public void ignorableWhitespace(char[] ch,
int start,
int length)
ignorableWhitespace in interface org.xml.sax.ContentHandlerch - char array of found whitespacesstart - int start position in arraylength - int length of what's been found
public void warning(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
warning in interface org.xml.sax.ErrorHandlere - SaxException object
org.xml.sax.SAXException - exception
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
error in interface org.xml.sax.ErrorHandlere - SaxException object
org.xml.sax.SAXException - thrown
public void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
fatalError in interface org.xml.sax.ErrorHandlere - SAXException object
org.xml.sax.SAXException - thrown
public void startDTD(java.lang.String arg0,
java.lang.String arg1,
java.lang.String arg2)
throws org.xml.sax.SAXException
startDTD in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endDTD()
throws org.xml.sax.SAXException
endDTD in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void startEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
startEntity in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endEntity(java.lang.String arg0)
throws org.xml.sax.SAXException
endEntity in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void startCDATA()
throws org.xml.sax.SAXException
startCDATA in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endCDATA()
throws org.xml.sax.SAXException
endCDATA in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void comment(char[] chars,
int start,
int length)
throws org.xml.sax.SAXException
comment in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXExceptionpublic static void main(java.lang.String[] args)
args - String arraypublic Envelope getEnvelope()
public TransactionSet getTransactionSet()
|
Open Business Objects for EDI v3.5.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||