| java.lang.Object org.xml.sax.helpers.DefaultHandler com.vividsolutions.jump.io.GMLInputTemplate
GMLInputTemplate | public class GMLInputTemplate extends DefaultHandler (Code) | | Reads an XML file that starts with a 'JCSGMLInputTemplate'.
Will abort read at the end of the 'JCSGMLInputTemplate' tag.
Constructs a description of the Columns and geometry tag so the
actual GML parser (
GMLReader ) will know what to do with different tags.
This is a SAX Handler.
|
Constructor Summary | |
public | GMLInputTemplate() constructor - makes a new org.apache.xerces.parser and makes this class be the SAX
content and error handler. |
Method Summary | |
public void | characters(char[] ch, int start, int length) | public String | columnName(int index) Returns the column name for the 'index'th column. | public void | endDocument() | public void | endElement(String uri, String name, String qName) | public void | error(SAXParseException exception) | public void | fatalError(SAXParseException exception) | public Object | getColumnValue(int index, String tagBody, Attributes xmlAtts) Given a ColumnDescription index, the XML tagBody, and the tag's attributes, return the
actual value (it could be an attribute or the tag's body). | public String | getFeatureCollectionElementName() | public String | getFeatureElementName() | public boolean | isGeometryElement(String tag) | public void | load(java.io.Reader r) | public void | load(java.io.Reader r, String readerName) Main function - load in an XML file. | int | lookupAttribute(Attributes atts, String att_name) Helper function - get attribute in a case insensitive manner. | public int | match(String XMLtagName, Attributes xmlAtts) Given a tag name and its XML attributes, find the index of the column it belongs to.
Returns -1 if it doesnt match any of the columns. | public void | startDocument() | public void | startElement(String uri, String name, String qName, Attributes atts) SAX startElement handler
Basically just records the tag name and its attributes since all the
smarts are in the endElement handler. | public FeatureSchema | toFeatureSchema() Converts this GMLInputTemplate to a feature schema. | public void | warning(SAXParseException exception) |
columnDef_tagType | int columnDef_tagType(Code) | | |
columnDef_valueAttribute | String columnDef_valueAttribute(Code) | | |
columnDef_valueType | int columnDef_valueType(Code) | | |
havecollectionTag | boolean havecollectionTag(Code) | | |
havefeatureTag | boolean havefeatureTag(Code) | | |
havegeometryElement | boolean havegeometryElement(Code) | | |
loaded | public boolean loaded(Code) | | |
GMLInputTemplate | public GMLInputTemplate()(Code) | | constructor - makes a new org.apache.xerces.parser and makes this class be the SAX
content and error handler.
|
characters | public void characters(char[] ch, int start, int length) throws SAXException(Code) | | SAX handler for characters - just store and accumulate for later use
|
columnName | public String columnName(int index) throws ParseException(Code) | | Returns the column name for the 'index'th column.
Parameters: index - 0=first |
endDocument | public void endDocument()(Code) | | SAX endDocument handler - null
|
endElement | public void endElement(String uri, String name, String qName) throws SAXException(Code) | | SAX endElement handler - the main working function
handles the following tags in the appropriate manner:
GeometryElement : sets the name of the document's geometry tag
CollectionElement : sets the name of the document's collection tag
FeatureElement : sets the name of the document's feature tag
type : sets a column type (to be used when a column ends)
valueelement : sets information about what element a column is associated with
valuelocation : set information about where a column's value is stored in the document
column : takes the accumlated information about a column and constructs a ColumnDescription object
|
getColumnValue | public Object getColumnValue(int index, String tagBody, Attributes xmlAtts) throws ParseException(Code) | | Given a ColumnDescription index, the XML tagBody, and the tag's attributes, return the
actual value (it could be an attribute or the tag's body). You probably got the index
from the match() function.
Parameters: index - index number of the column description Parameters: tagBody - value of the XML tag body Parameters: xmlAtts - key/values of the XML tag's attributes |
getFeatureCollectionElementName | public String getFeatureCollectionElementName() throws ParseException(Code) | | Get the name of the FeatureCollectionElement tag
|
isGeometryElement | public boolean isGeometryElement(String tag)(Code) | | Function to help the GMLParser - is this tag name the Geometry Element tag name?
Parameters: tag - an XML tag name |
load | public void load(java.io.Reader r, String readerName) throws ParseException, IOException(Code) | | Main function - load in an XML file.
Error handling/reporting also done here.
Parameters: r - where to read the XML file from Parameters: readerName - name of the stream for error reporting |
lookupAttribute | int lookupAttribute(Attributes atts, String att_name)(Code) | | Helper function - get attribute in a case insensitive manner.
returns index or -1 if not found.
Parameters: atts - the attributes for the xml tag (from SAX) Parameters: att_name - the name of the attribute to search for |
match | public int match(String XMLtagName, Attributes xmlAtts) throws ParseException(Code) | | Given a tag name and its XML attributes, find the index of the column it belongs to.
Returns -1 if it doesnt match any of the columns.
Parameters: XMLtagName - the tag name found in the xml Parameters: the - attributes associated with the xml |
startDocument | public void startDocument()(Code) | | SAX startDocument handler - null
|
startElement | public void startElement(String uri, String name, String qName, Attributes atts) throws SAXException(Code) | | SAX startElement handler
Basically just records the tag name and its attributes since all the
smarts are in the endElement handler.
|
Methods inherited from org.xml.sax.helpers.DefaultHandler | public void characters(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void endDocument() throws SAXException(Code)(Java Doc) public void endElement(String uri, String localName, String qName) throws SAXException(Code)(Java Doc) public void endPrefixMapping(String prefix) throws SAXException(Code)(Java Doc) public void error(SAXParseException e) throws SAXException(Code)(Java Doc) public void fatalError(SAXParseException e) throws SAXException(Code)(Java Doc) public void ignorableWhitespace(char ch, int start, int length) throws SAXException(Code)(Java Doc) public void notationDecl(String name, String publicId, String systemId) throws SAXException(Code)(Java Doc) public void processingInstruction(String target, String data) throws SAXException(Code)(Java Doc) public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException(Code)(Java Doc) public void setDocumentLocator(Locator locator)(Code)(Java Doc) public void skippedEntity(String name) throws SAXException(Code)(Java Doc) public void startDocument() throws SAXException(Code)(Java Doc) public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri) throws SAXException(Code)(Java Doc) public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException(Code)(Java Doc) public void warning(SAXParseException e) throws SAXException(Code)(Java Doc)
|
|
|