Class GmlHandler
java.lang.Object
org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
org.codice.ddf.transformer.xml.streaming.impl.GmlHandler
- All Implemented Interfaces:
org.codice.ddf.transformer.xml.streaming.SaxEventHandler,ContentHandler
public class GmlHandler
extends org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
A sax event handler to handle GML sax events and stores the data as a WKT. Delegates GML events
to
GMLHandler. Uses WKTWriter to write the Geometries to WKT. Note: ONLY CAN PARSE GML2
points. Will throw hard-to-debug Null Pointer Exceptions if used with GML3 or other GML2
geometries. -
Constructor Summary
ConstructorsConstructorDescriptionGmlHandler(org.locationtech.jts.io.gml2.GMLHandler gmlHandler, org.codice.ddf.transformer.xml.streaming.Gml3ToWkt gml3Converter) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Takes in a sax event fromSaxEventHandlerDelegate, and if it is a gml:Point or a sub-element of a gml:Point, it will * hand the event off to the GML handler for further parsing.voidendElement(String namespaceURI, String localName, String qName) Takes in a sax event fromSaxEventHandlerDelegate, and if it is a gml:Point or a sub-element of a gml:Point, it will * hand the event off to the GML handler for further parsing.List<ddf.catalog.data.Attribute> Set<ddf.catalog.data.AttributeDescriptor> voidstartElement(String uri, String localName, String qName, Attributes attributes) Takes in a sax event fromSaxEventHandlerDelegate, and if it is a gml:Point or a sub-element of a gml:Point, it will hand the event off to the GML handler for further parsing.voidstartPrefixMapping(String prefix, String uri) Methods inherited from class org.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler
endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocumentMethods 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
-
GmlHandler
public GmlHandler(org.locationtech.jts.io.gml2.GMLHandler gmlHandler, org.codice.ddf.transformer.xml.streaming.Gml3ToWkt gml3Converter)
-
-
Method Details
-
getAttributes
- Returns:
- list of
Attribute(should be all invalid input: '<'Metacard.GEOGRAPHY, WKT strings>)
-
getSupportedAttributeDescriptors
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classorg.codice.ddf.transformer.xml.streaming.AbstractSaxEventHandler- Throws:
SAXException
-
startElement
Takes in a sax event fromSaxEventHandlerDelegate, and if it is a gml:Point or a sub-element of a gml:Point, it will hand the event off to the GML handler for further parsing.- 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, and if it is a gml:Point or a sub-element of a gml:Point, it will * hand the event off to the GML handler for further parsing. If it is a gml:Point, the point is stored as a WKT in 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 fromSaxEventHandlerDelegate, and if it is a gml:Point or a sub-element of a gml:Point, it will * hand the event off to the GML handler for further parsing.- Parameters:
ch- the ch that is passed in bySaxEventHandlerDelegatestart- the start that is passed in bySaxEventHandlerDelegatelength- the length that is passed in bySaxEventHandlerDelegate
-