Package org.h2gis.functions.io.gpx.model
Class AbstractGpxParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.h2gis.functions.io.gpx.model.AbstractGpxParser
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
AbstractGpxParserDefault,AbstractGpxParserRte,AbstractGpxParserTrk,AbstractGpxParserWpt
Abstract class of all Gpx-Parsers. It contains the more general attributes,
setters and getters used in parsers. It also defines the method characters
which is used in all other parsers.
- Author:
- Erwan Bocher and Antonin Piasco
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Fires one or more times for each text node encountered.Gives the actual contentBufferGives a string representing the value of the element which is being parsed.Gives the line which is being parsed.Gives the point which is being parsed.Gives the segment which is being parsed.Gives the actual StringStack elementNamesorg.locationtech.jts.geom.GeometryFactoryGives a geometryFactory to construct gpx geometriesGives the XMLReader used to parse the document.Gives the preparedstatement used to store route dataGives the prepared statement used to store the route points.Gives the prepared statement used to store the track points.Gives the prepared statement used to store the track.Gives the prepared statement used to store the track segments.Get the PreparedStatement of the waypoints table.booleanIndicates if we are in a specific element (waypoint, route or track).voidsetContentBuffer(StringBuilder contentBuffer) Set the contentBuffer.voidsetCurrentElement(String currentElement) Set the string representing the value of the element which is being parsed.voidsetCurrentLine(GPXLine currentLine) Set the line which will be parsed.voidsetCurrentPoint(GPXPoint currentPoint) Set the point which will be parsed.voidsetCurrentSegment(GPXLine currentSegment) Set the segment which will be parsed.voidsetElementNames(StringStack elementNames) Set the actual StringStack elementNamesvoidSet the XMLReader used to parse the document.voidsetRtePreparedStmt(PreparedStatement rtePreparedStmt) Set the PreparedStatement of the route table.voidsetRteptPreparedStmt(PreparedStatement rteptPreparedStmt) Set the PreparedStatement of the route points table.voidsetSpecificElement(boolean specificElement) Set the indicator to know if we are in a specific element.voidsetTrkPointsPreparedStmt(PreparedStatement trkPointsPreparedStmt) Set the prepared statement used to store the track points.voidsetTrkPreparedStmt(PreparedStatement trkPreparedStmt) Set the prepared statement used to store the track.voidsetTrkSegmentsPreparedStmt(PreparedStatement trkSegmentsPreparedStmt) Set the prepared statement used to store the track segments.voidsetWptPreparedStmt(PreparedStatement wptPreparedStmt) Set the PreparedStatement of the waypoints table.Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warningMethods 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
-
AbstractGpxParser
public AbstractGpxParser()
-
-
Method Details
-
characters
Fires one or more times for each text node encountered. It saves text informations in contentBuffer.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Parameters:
ch- The characters from the XML documentstart- The start position in the arraylength- The number of characters to read from the array- Throws:
SAXException- Any SAX exception, possibly wrapping another exception
-
getContentBuffer
Gives the actual contentBuffer- Returns:
-
setContentBuffer
Set the contentBuffer.- Parameters:
contentBuffer-
-
getCurrentElement
Gives a string representing the value of the element which is being parsed.- Returns:
-
setCurrentElement
Set the string representing the value of the element which is being parsed.- Parameters:
currentElement-
-
getCurrentPoint
Gives the point which is being parsed.- Returns:
-
setCurrentPoint
Set the point which will be parsed.- Parameters:
currentPoint-
-
getReader
Gives the XMLReader used to parse the document.- Returns:
-
setReader
Set the XMLReader used to parse the document.- Parameters:
reader-
-
getElementNames
Gives the actual StringStack elementNames- Returns:
-
setElementNames
Set the actual StringStack elementNames- Parameters:
elementNames-
-
isSpecificElement
public boolean isSpecificElement()Indicates if we are in a specific element (waypoint, route or track).- Returns:
- true if we are in a specific element, false else
-
setSpecificElement
public void setSpecificElement(boolean specificElement) Set the indicator to know if we are in a specific element.- Parameters:
specificElement-
-
getWptPreparedStmt
Get the PreparedStatement of the waypoints table.- Returns:
-
setWptPreparedStmt
Set the PreparedStatement of the waypoints table.- Parameters:
wptPreparedStmt-
-
setRtePreparedStmt
Set the PreparedStatement of the route table.- Parameters:
rtePreparedStmt-
-
getRtePreparedStmt
Gives the preparedstatement used to store route data- Returns:
-
setRteptPreparedStmt
Set the PreparedStatement of the route points table.- Parameters:
rteptPreparedStmt-
-
getRteptPreparedStmt
Gives the prepared statement used to store the route points.- Returns:
-
getTrkPreparedStmt
Gives the prepared statement used to store the track.- Returns:
-
getTrkPointsPreparedStmt
Gives the prepared statement used to store the track points.- Returns:
-
getTrkSegmentsPreparedStmt
Gives the prepared statement used to store the track segments.- Returns:
-
setTrkPreparedStmt
Set the prepared statement used to store the track.- Parameters:
trkPreparedStmt-
-
setTrkSegmentsPreparedStmt
Set the prepared statement used to store the track segments.- Parameters:
trkSegmentsPreparedStmt-
-
setTrkPointsPreparedStmt
Set the prepared statement used to store the track points.- Parameters:
trkPointsPreparedStmt-
-
getCurrentSegment
Gives the segment which is being parsed.- Returns:
-
setCurrentSegment
Set the segment which will be parsed.- Parameters:
currentSegment-
-
getGeometryFactory
public org.locationtech.jts.geom.GeometryFactory getGeometryFactory()Gives a geometryFactory to construct gpx geometries- Returns:
-
getCurrentLine
Gives the line which is being parsed.- Returns:
-
setCurrentLine
Set the line which will be parsed.- Parameters:
currentLine-
-