com.americancoders.edi
Class ValidXMLEDIParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.americancoders.edi.ValidXMLEDIParser

public class ValidXMLEDIParser
extends org.xml.sax.helpers.DefaultHandler

class builds OBOE objects by parsing input string in valid xml edi format

OBOE - Open Business Objects for EDI
An EDI and XML Translator Written In Java
Copyright 1998-2000 - 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

Version:
1.5.0
Author:
Joe McVerry, American Coders Ltd.

Field Summary
protected  int _iElement
           
protected  int _iLine
           
protected  CompositeDE composite
           
protected  ICompositeDEContainer compositeContainer
           
protected  java.io.CharArrayWriter contents
           
protected  Table detailTable
           
protected  DataElement element
           
protected  IDataElementContainer elementContainer
           
protected  int elementCount
           
protected  Table headerTable
           
protected  TransactionSet parsedTransactionSet
           
protected  org.apache.xerces.parsers.SAXParser parser
           
protected  Segment segment
           
protected  SegmentContainer segmentContainer
           
protected  java.util.Stack segmentStack
           
protected  Table summaryTable
           
protected  Table table
           
 
Constructor Summary
ValidXMLEDIParser()
          create a transaction set from input string
 
Method Summary
static TransactionSet buildTransactionSet(java.lang.String inTSID)
          static class method will build a transaction set based on input string and OBOE.properties defintion see OBOE.properties file to define the directory path
 void characters(char[] ch, int start, int length)
          Method declaration
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName)
          Method declaration
 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
 TransactionSet getTransactionSet()
          returns the transaction set that was parsed
 void ignorableWhitespace(char[] ch, int start, int length)
           
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
 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 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, resolveEntity, 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

parsedTransactionSet

protected TransactionSet parsedTransactionSet

_iElement

protected int _iElement

_iLine

protected int _iLine

table

protected Table table

headerTable

protected Table headerTable

detailTable

protected Table detailTable

summaryTable

protected Table summaryTable

segment

protected Segment segment

composite

protected CompositeDE composite

element

protected DataElement element

segmentContainer

protected SegmentContainer segmentContainer

compositeContainer

protected ICompositeDEContainer compositeContainer

elementContainer

protected IDataElementContainer elementContainer

segmentStack

protected java.util.Stack segmentStack

elementCount

protected int elementCount

contents

protected java.io.CharArrayWriter contents

parser

protected org.apache.xerces.parsers.SAXParser parser
Constructor Detail

ValidXMLEDIParser

public ValidXMLEDIParser()
                  throws java.lang.Exception
create a transaction set from input string
Parameters:
inString - the edi document
Throws:
java.lang.Exception - - unknown transaction set, this transaction set is undefined to OBOE
Method Detail

parse

public void parse(java.lang.String text)
           throws java.lang.Exception
parse an xml document coming in as a String
Parameters:
String -  
Throws:
java.lang.Exception - - as thrown by the parser

parseFile

public void parseFile(java.lang.String filename)
               throws java.lang.Exception
parse an xml
Parameters:
String - - incoming file name
Throws:
java.lang.Exception - - as thrown by the parser

startElement

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
method called for each xml element found.
process logic
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
String - data element name
AttributeList - attributes associated with data element

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String rawName)
                throws org.xml.sax.SAXException
Method declaration
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
name -  
Throws:
org.xml.sax.SAXException -  

characters

public void characters(char[] ch,
                       int start,
                       int length)
Method declaration
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Parameters:
ch -  
start -  
length -  

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
Overrides:
ignorableWhitespace in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
catches warning SAXParseExceptions this code sends exception to stdio and allows public classto continue
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
catches error SAXParseExceptions this code causes exception to continue
Overrides:
error in class org.xml.sax.helpers.DefaultHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
catches fatal SAXParseExceptions this code causes exception to continue
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler

buildTransactionSet

public static TransactionSet buildTransactionSet(java.lang.String inTSID)
                                          throws java.lang.Exception
static class method will build a transaction set based on input string and OBOE.properties defintion see OBOE.properties file to define the directory path
Parameters:
String - transaction id
Returns:
TransactionSet

main

public static void main(java.lang.String[] args)
static main method to test xmlparser class

getTransactionSet

public TransactionSet getTransactionSet()
returns the transaction set that was parsed
Returns:
TransactionSet - the transaction set parsed when object was built.