ca.uhn.hl7v2.preparser
Class XML.HL7MessageHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
ca.uhn.hl7v2.preparser.XML.HL7MessageHandler
- All Implemented Interfaces:
- org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
- Enclosing class:
- XML
protected static class XML.HL7MessageHandler
- extends org.xml.sax.helpers.DefaultHandler
the SAXParser reports parsing events to an object of this class.
We keep track of some parsing state, and the Properties object that
we're supposed to write our data to.
Field Summary |
java.util.Collection |
m_msgMask
Specifies what parts of a message should be dumped to m_props. |
java.util.Properties |
m_props
The data that is found while parsing, and which passes m_msgMask,
will be dumped to m_props, as (DatumPath.toString() / text) key/value
pairs |
protected boolean |
m_startedDocument
|
Method Summary |
void |
characters(char[] chars,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
void |
error(org.xml.sax.SAXParseException e)
|
void |
fatalError(org.xml.sax.SAXParseException e)
|
void |
ignoreableWhitespace(char[] chars,
int start,
int length)
|
void |
startDocument()
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
protected void |
tryToDumpDataToProps()
try to dump whatever we've got in m_chars to m_props,
with a key of m_curPath.toString(). |
protected static boolean |
tryToGrowDocLocationFromElementName(java.lang.StringBuffer msgID,
DatumPath curPath,
java.util.Map segmentId2nextRepIdx,
DatumPath lastDumpedPath,
java.lang.String elementName)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_props
public java.util.Properties m_props
- The data that is found while parsing, and which passes m_msgMask,
will be dumped to m_props, as (DatumPath.toString() / text) key/value
pairs
m_msgMask
public java.util.Collection m_msgMask
- Specifies what parts of a message should be dumped to m_props.
m_startedDocument
protected boolean m_startedDocument
XML.HL7MessageHandler
public XML.HL7MessageHandler()
startDocument
public void startDocument()
throws org.xml.sax.SAXException
- Specified by:
startDocument
in interface org.xml.sax.ContentHandler
- Overrides:
startDocument
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
endDocument
public void endDocument()
throws org.xml.sax.SAXException
- Specified by:
endDocument
in interface org.xml.sax.ContentHandler
- Overrides:
endDocument
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
startElement
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
- Specified by:
startElement
in interface org.xml.sax.ContentHandler
- Overrides:
startElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
tryToGrowDocLocationFromElementName
protected static boolean tryToGrowDocLocationFromElementName(java.lang.StringBuffer msgID,
DatumPath curPath,
java.util.Map segmentId2nextRepIdx,
DatumPath lastDumpedPath,
java.lang.String elementName)
endElement
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
- Specified by:
endElement
in interface org.xml.sax.ContentHandler
- Overrides:
endElement
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
tryToDumpDataToProps
protected void tryToDumpDataToProps()
- try to dump whatever we've got in m_chars to m_props,
with a key of m_curPath.toString().
characters
public void characters(char[] chars,
int start,
int length)
- Specified by:
characters
in interface org.xml.sax.ContentHandler
- Overrides:
characters
in class org.xml.sax.helpers.DefaultHandler
ignoreableWhitespace
public void ignoreableWhitespace(char[] chars,
int start,
int length)
error
public void error(org.xml.sax.SAXParseException e)
- Specified by:
error
in interface org.xml.sax.ErrorHandler
- Overrides:
error
in class org.xml.sax.helpers.DefaultHandler
fatalError
public void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXException
- Specified by:
fatalError
in interface org.xml.sax.ErrorHandler
- Overrides:
fatalError
in class org.xml.sax.helpers.DefaultHandler
- Throws:
org.xml.sax.SAXException
Copyright © 2001-2011 University Health Network. All Rights Reserved.