Package 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
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
FieldsModifier and TypeFieldDescriptionSpecifies what parts of a message should be dumped to 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 pairsprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] chars, int start, int length) voidvoidendElement(String uri, String localName, String qName) voidvoidvoidignoreableWhitespace(char[] chars, int start, int length) voidvoidstartElement(String uri, String localName, String qName, Attributes attributes) protected voidtry to dump whatever we've got in m_chars to m_props, with a key of m_curPath.toString().protected static booleantryToGrowDocLocationFromElementName(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, warningMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
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
Specifies what parts of a message should be dumped to m_props. -
m_startedDocument
-
-
Constructor Details
-
HL7MessageHandler
public HL7MessageHandler()
-
-
Method Details
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
tryToGrowDocLocationFromElementName
protected static boolean tryToGrowDocLocationFromElementName(StringBuffer msgID, DatumPath curPath, Map<String, Integer> segmentId2nextRepIdx, DatumPath lastDumpedPath, String elementName) -
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
tryToDumpDataToProps
try to dump whatever we've got in m_chars to m_props, with a key of m_curPath.toString(). -
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
ignoreableWhitespace
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-