Class XmlSaxEventHandlerImpl
java.lang.Object
org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
org.codice.ddf.transformer.xml.streaming.impl.XmlSaxEventHandlerImpl
- All Implemented Interfaces:
org.codice.ddf.transformer.xml.streaming.SaxEventHandler,ContentHandler
public class XmlSaxEventHandlerImpl
extends org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
A sax event handler used to parse urn:catalog:metacard
Metacards. By default, handles all
elements defined in the xmlToMetacard These defaults can be
overridden by passing a different Map in
invalid reference
XmlSaxEventHandlerImpl#setXmlToMetacard(Map)
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedXmlSaxEventHandlerImpl(Map<String, String> xmlToMetacardMap) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Takes in a sax event fromSaxEventHandlerDelegateand adds the characters to textDataOfElementvoidendElement(String namespaceURI, String localName, String qName) Takes in a sax event fromSaxEventHandlerDelegate.List<ddf.catalog.data.Attribute> Set<ddf.catalog.data.AttributeDescriptor> voidvoidstartElement(String uri, String localName, String qName, Attributes attributes) Takes in a sax event fromSaxEventHandlerDelegate, and if it is in the xmlToMetacardMapping, begin reading it.Methods inherited from class org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMappingMethods 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
-
Constructor Details
-
XmlSaxEventHandlerImpl
protected XmlSaxEventHandlerImpl() -
XmlSaxEventHandlerImpl
-
-
Method Details
-
getAttributes
-
getSupportedAttributeDescriptors
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classorg.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
-
startElement
Takes in a sax event fromSaxEventHandlerDelegate, and if it is in the xmlToMetacardMapping, begin reading it.- Parameters:
uri- the URI that is passed in bySaxEventHandlerDelegatelocalName- the localName that is passed in bySaxEventHandlerDelegateqName- the qName that is passed in bySaxEventHandlerDelegateattributes- the attributes that are passed in bySaxEventHandlerDelegate
-
endElement
Takes in a sax event fromSaxEventHandlerDelegate. If the element is in the xmlToElementMapping, add it to the attributes list- Parameters:
namespaceURI- the namespaceURI that is passed in bySaxEventHandlerDelegatelocalName- the localName that is passed in bySaxEventHandlerDelegateqName- the qName that is passed in bySaxEventHandlerDelegate
-
characters
public void characters(char[] ch, int start, int length) Takes in a sax event fromSaxEventHandlerDelegateand adds the characters to textDataOfElement- Parameters:
ch- the ch that is passed in bySaxEventHandlerDelegatestart- the start that is passed in bySaxEventHandlerDelegatelength- the length that is passed in bySaxEventHandlerDelegate
-