Class GMLHandler

Hierarchy: Object , Object , DefaultHandler , GMLHandler
public class GMLHandler
extends DefaultHandler
A SAX DefaultHandler which builds Geometrys from GML2-formatted geometries. An XML parser can delegate SAX events to this handler to parse and building Geometrys.

This handler currently ignores both namespaces and prefixes. Hints:

Authors:
David Zwiers, Vivid Solutions.
See also:
DefaultHandler
public GMLHandler(GeometryFactory gf, ErrorHandler delegate)
Creates a new handler. Allows the user to specify a delegate object for error / warning messages. If the delegate also implements ContentHandler then the document Locator will be passed on.
Parameters:
gf - gf Geometry Factory
delegate - delegate Nullable
See also:
ErrorHandler
ContentHandler
ContentHandler#setDocumentLocator(org.xml.sax.Locator)
org.xml.sax.Locator
public boolean isGeometryComplete()
Tests whether this handler has completed parsing a geometry. If this is the case, getGeometry() can be called to get the value of the parsed geometry.
Returns:
if the parsing of the geometry is complete
public Geometry getGeometry()
Gets the geometry parsed by this handler. This method should only be called AFTER the parser has completed execution
Returns:
the parsed Geometry, or a GeometryCollection if more than one geometry was parsed
Throws:
IllegalStateException - IllegalStateException if called before the parse is complete
public void characters(char[] ch, int start, int length)
See also:
org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
public void ignorableWhitespace(char[] ch, int start, int length)
See also:
org.xml.sax.helpers.DefaultHandler#ignorableWhitespace(char[], int, int)
public void endElement(String uri, String localName, String qName)
See also:
org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
public void startElement(String uri, String localName, String qName, Attributes attributes)
See also:
org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void setDocumentLocator(Locator locator)
See also:
org.xml.sax.helpers.DefaultHandler#setDocumentLocator(org.xml.sax.Locator)
protected Locator getDocumentLocator()
public void fatalError(SAXParseException e)
See also:
org.xml.sax.helpers.DefaultHandler#fatalError(org.xml.sax.SAXParseException)
public void error(SAXParseException e)
See also:
org.xml.sax.helpers.DefaultHandler#error(org.xml.sax.SAXParseException)
public void warning(SAXParseException e)
See also:
org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException)