ca.uhn.hl7v2.preparser
Class XML.HL7MessageHandler
java.lang.Object
org.xml.sax.helpers.DefaultHandler
ca.uhn.hl7v2.preparser.XML.HL7MessageHandler
- All Implemented Interfaces:
- ContentHandler, DTDHandler, EntityResolver, 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.
|
Method Summary |
void |
characters(char[] chars,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
error(SAXParseException e)
|
void |
fatalError(SAXParseException e)
|
void |
ignoreableWhitespace(char[] chars,
int start,
int length)
|
void |
startDocument()
|
void |
startElement(String uri,
String localName,
String qName,
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(StringBuffer msgID,
DatumPath curPath,
Map<String,Integer> segmentId2nextRepIdx,
DatumPath lastDumpedPath,
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 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 Collection<DatumPath> 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 SAXException
- Specified by:
startDocument in interface ContentHandler- Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
endDocument
public void endDocument()
throws SAXException
- Specified by:
endDocument in interface ContentHandler- Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
- Specified by:
startElement in interface ContentHandler- Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
tryToGrowDocLocationFromElementName
protected static boolean tryToGrowDocLocationFromElementName(StringBuffer msgID,
DatumPath curPath,
Map<String,Integer> segmentId2nextRepIdx,
DatumPath lastDumpedPath,
String elementName)
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
- Specified by:
endElement in interface ContentHandler- Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
- Throws:
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 ContentHandler- Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
ignoreableWhitespace
public void ignoreableWhitespace(char[] chars,
int start,
int length)
error
public void error(SAXParseException e)
- Specified by:
error in interface ErrorHandler- Overrides:
error in class org.xml.sax.helpers.DefaultHandler
fatalError
public void fatalError(SAXParseException e)
throws SAXException
- Specified by:
fatalError in interface ErrorHandler- Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
- Throws:
SAXException
Copyright © 2001-2012 University Health Network. All Rights Reserved.