org.milyn.edisax.unedifact
Class UNEdifactInterchangeParser

java.lang.Object
  extended by org.milyn.edisax.unedifact.UNEdifactInterchangeParser
All Implemented Interfaces:
HierarchyChangeReader, org.xml.sax.XMLReader

public class UNEdifactInterchangeParser
extends java.lang.Object
implements org.xml.sax.XMLReader, HierarchyChangeReader

UN/EDIFACT Interchange Envelope parser.

Author:
tom.fennelly@gmail.com

Field Summary
static Delimiters defaultUNEdifactDelimiters
           
 
Constructor Summary
UNEdifactInterchangeParser()
           
 
Method Summary
 UNEdifactInterchangeParser addMappingModel(EdifactModel mappingModel)
          Add EDI mapping model to be used in all subsequent parse operations.
 UNEdifactInterchangeParser addMappingModels(java.util.Map<Description,EdifactModel> mappingModels)
          Add EDI mapping model to be used in all subsequent parse operations.
 UNEdifactInterchangeParser addMappingModels(java.lang.String mappingModelFiles, java.net.URI baseURI)
          Add EDI mapping model to be used in all subsequent parse operations.
protected  InterchangeContext createInterchangeContext(BufferedSegmentReader segmentReader, boolean validate, ControlBlockHandlerFactory controlBlockHandlerFactory)
           
 org.xml.sax.ContentHandler getContentHandler()
           
 org.xml.sax.DTDHandler getDTDHandler()
           
 org.xml.sax.EntityResolver getEntityResolver()
           
 org.xml.sax.ErrorHandler getErrorHandler()
           
 boolean getFeature(java.lang.String name)
           
 InterchangeContext getInterchangeContext()
           
 java.util.Map<Description,EdifactModel> getMappingModels()
           
 java.lang.Object getProperty(java.lang.String name)
           
 void ignoreNewLines(boolean ignoreNewLines)
           
 void parse(org.xml.sax.InputSource unedifactInterchange)
           
 void parse(java.lang.String systemId)
          The following methods are currently unimplemnted...
 void setContentHandler(org.xml.sax.ContentHandler contentHandler)
           
 void setDTDHandler(org.xml.sax.DTDHandler arg0)
           
 void setEntityResolver(org.xml.sax.EntityResolver arg0)
           
 void setErrorHandler(org.xml.sax.ErrorHandler arg0)
           
 void setFeature(java.lang.String name, boolean value)
           
 void setHierarchyChangeListener(HierarchyChangeListener listener)
           
 UNEdifactInterchangeParser setMappingModels(java.util.Map<Description,EdifactModel> mappingModels)
          Set the EDI mapping model to be used in all subsequent parse operations.
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void validate(boolean validate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultUNEdifactDelimiters

public static final Delimiters defaultUNEdifactDelimiters
Constructor Detail

UNEdifactInterchangeParser

public UNEdifactInterchangeParser()
Method Detail

parse

public void parse(org.xml.sax.InputSource unedifactInterchange)
           throws java.io.IOException,
                  org.xml.sax.SAXException
Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

createInterchangeContext

protected InterchangeContext createInterchangeContext(BufferedSegmentReader segmentReader,
                                                      boolean validate,
                                                      ControlBlockHandlerFactory controlBlockHandlerFactory)

getInterchangeContext

public InterchangeContext getInterchangeContext()

getMappingModels

public java.util.Map<Description,EdifactModel> getMappingModels()

setMappingModels

public UNEdifactInterchangeParser setMappingModels(java.util.Map<Description,EdifactModel> mappingModels)
Set the EDI mapping model to be used in all subsequent parse operations.

The model can be generated through a call to the EDIParser.

Parameters:
mappingModels - The mapping model.
Returns:
This parser instance.

addMappingModels

public UNEdifactInterchangeParser addMappingModels(java.util.Map<Description,EdifactModel> mappingModels)
Add EDI mapping model to be used in all subsequent parse operations.

The model can be generated through a call to the EDIParser.

Parameters:
mappingModels - The mapping model.
Returns:
This parser instance.

addMappingModels

public UNEdifactInterchangeParser addMappingModels(java.lang.String mappingModelFiles,
                                                   java.net.URI baseURI)
                                            throws EDIConfigurationException,
                                                   java.io.IOException,
                                                   org.xml.sax.SAXException
Add EDI mapping model to be used in all subsequent parse operations.

Parameters:
mappingModelFiles - Semi-colon separated list of mapping model files. Supports zip files.
baseURI - The base URI against which the mapping model URIs is to be resolved.
Returns:
This parser instance.
Throws:
EDIConfigurationException - Error processing one of the Mapping Model configs.
org.xml.sax.SAXException
java.io.IOException

addMappingModel

public UNEdifactInterchangeParser addMappingModel(EdifactModel mappingModel)
Add EDI mapping model to be used in all subsequent parse operations.

The model can be generated through a call to the EDIParser.

Parameters:
mappingModel - The mapping model.
Returns:
This parser instance.

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Specified by:
getContentHandler in interface org.xml.sax.XMLReader

setContentHandler

public void setContentHandler(org.xml.sax.ContentHandler contentHandler)
Specified by:
setContentHandler in interface org.xml.sax.XMLReader

ignoreNewLines

public void ignoreNewLines(boolean ignoreNewLines)

validate

public void validate(boolean validate)

setFeature

public void setFeature(java.lang.String name,
                       boolean value)
Specified by:
setFeature in interface org.xml.sax.XMLReader

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Specified by:
getFeature in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setHierarchyChangeListener

public void setHierarchyChangeListener(HierarchyChangeListener listener)
Specified by:
setHierarchyChangeListener in interface HierarchyChangeReader

parse

public void parse(java.lang.String systemId)
           throws java.io.IOException,
                  org.xml.sax.SAXException
The following methods are currently unimplemnted...

Specified by:
parse in interface org.xml.sax.XMLReader
Throws:
java.io.IOException
org.xml.sax.SAXException

getDTDHandler

public org.xml.sax.DTDHandler getDTDHandler()
Specified by:
getDTDHandler in interface org.xml.sax.XMLReader

setDTDHandler

public void setDTDHandler(org.xml.sax.DTDHandler arg0)
Specified by:
setDTDHandler in interface org.xml.sax.XMLReader

getEntityResolver

public org.xml.sax.EntityResolver getEntityResolver()
Specified by:
getEntityResolver in interface org.xml.sax.XMLReader

setEntityResolver

public void setEntityResolver(org.xml.sax.EntityResolver arg0)
Specified by:
setEntityResolver in interface org.xml.sax.XMLReader

getErrorHandler

public org.xml.sax.ErrorHandler getErrorHandler()
Specified by:
getErrorHandler in interface org.xml.sax.XMLReader

setErrorHandler

public void setErrorHandler(org.xml.sax.ErrorHandler arg0)
Specified by:
setErrorHandler in interface org.xml.sax.XMLReader

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
Specified by:
getProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
Specified by:
setProperty in interface org.xml.sax.XMLReader
Throws:
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException


Copyright © 2011. All Rights Reserved.