Package org.h2gis.functions.io.gpx.model
Class GpxParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.h2gis.functions.io.gpx.model.AbstractGpxParser
-
- org.h2gis.functions.io.gpx.model.AbstractGpxParserDefault
-
- org.h2gis.functions.io.gpx.model.GpxParser
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class GpxParser extends AbstractGpxParserDefault
Default parser. This class parses GPX 1.1 files and saves them in a file. It set a contentHandler by default which is able to save general information about the document. To save specific information (waypoints, routes and tracks) it will call specific classes.- Author:
- Erwan Bocher and Antonin Piasco
-
-
Field Summary
-
Fields inherited from class org.h2gis.functions.io.gpx.model.AbstractGpxParserDefault
STRINGSTACK_SIZE
-
-
Constructor Summary
Constructors Constructor Description GpxParser(Connection connection, File fileName, String encoding, boolean deleteTable)Create a new GPX parser and specify what kind of data must be parsed in the GPX file
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Initialisation of all the indicators used to read the document.voidendElement(String uri, String localName, String qName)Fires whenever an XML end markup is encountered.StringgetCopyright()Gives copyright and license information governing use of the file.voidstartElement(String uri, String localName, String qName, Attributes attributes)Fires whenever an XML start markup is encountered.-
Methods inherited from class org.h2gis.functions.io.gpx.model.AbstractGpxParserDefault
getCreator, getDesc, getFullAuthor, getFullLink, getKeywords, getMaxLat, getMaxLon, getMinLat, getMinLon, getName, getRteParser, getTime, getTrkParser, getVersion, getWptParser, read, setAuthorLink, setAuthorLinkText, setAuthorName, setEmail, setLink, setLinkText, setName, setRteParser, setTrkParser, setWptParser
-
Methods inherited from class org.h2gis.functions.io.gpx.model.AbstractGpxParser
characters, getContentBuffer, getCurrentElement, getCurrentLine, getCurrentPoint, getCurrentSegment, getElementNames, getGeometryFactory, getReader, getRtePreparedStmt, getRteptPreparedStmt, getTrkPointsPreparedStmt, getTrkPreparedStmt, getTrkSegmentsPreparedStmt, getWptPreparedStmt, isSpecificElement, setContentBuffer, setCurrentElement, setCurrentLine, setCurrentPoint, setCurrentSegment, setElementNames, setReader, setRtePreparedStmt, setRteptPreparedStmt, setSpecificElement, setTrkPointsPreparedStmt, setTrkPreparedStmt, setTrkSegmentsPreparedStmt, setWptPreparedStmt
-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
-
-
-
-
Constructor Detail
-
GpxParser
public GpxParser(Connection connection, File fileName, String encoding, boolean deleteTable)
Create a new GPX parser and specify what kind of data must be parsed in the GPX file
-
-
Method Detail
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
Fires whenever an XML start markup is encountered. It takes general information about the document. It change the ContentHandler to parse specific informations when<wpt>,<rte>or<trk>markup are found.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classAbstractGpxParserDefault- Parameters:
uri- URI of the local elementlocalName- Name of the local element (without prefix)qName- qName of the local element (with prefix)attributes- Attributes of the local element (contained in the markup)- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName)
Fires whenever an XML end markup is encountered. It catches attributes of the different elements and saves them in corresponding values[].- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classAbstractGpxParserDefault- Parameters:
uri- URI of the local elementlocalName- Name of the local element (without prefix)qName- qName of the local element (with prefix)
-
clear
public void clear()
Initialisation of all the indicators used to read the document.- Overrides:
clearin classAbstractGpxParserDefault
-
getCopyright
public String getCopyright()
Gives copyright and license information governing use of the file.- Returns:
-
-