Package org.h2gis.functions.io.gpx.model
Class AbstractGpxParserRte
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.h2gis.functions.io.gpx.model.AbstractGpxParser
-
- org.h2gis.functions.io.gpx.model.AbstractGpxParserRte
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
- Direct Known Subclasses:
GpxParserRte
public abstract class AbstractGpxParserRte extends AbstractGpxParser
Abstract class of the parsers dedicated to routes. A specific parser for version 1.0 and version 1.1 will extend this class.- Author:
- Erwan Bocher and Antonin Piasco
-
-
Constructor Summary
Constructors Constructor Description AbstractGpxParserRte()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendElement(String uri, String localName, String qName)Fires whenever an XML end markup is encountered.voidinitialise(XMLReader reader, AbstractGpxParserDefault parent)Create a new specific parser.booleanisPoint()Indicates if we are in a point.voidsetParent(AbstractGpxParserDefault parent)Set the parent of this specific parser.voidsetRteList(List<org.locationtech.jts.geom.Coordinate> rteList)Set the list corresponding to the points' coordinates of the actual route.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.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
-
-
-
-
Method Detail
-
initialise
public void initialise(XMLReader reader, AbstractGpxParserDefault parent)
Create a new specific parser. It has in memory the default parser, the contentBuffer, the elementNames, the currentLine and the rteID.- Parameters:
reader- The XMLReader used in the default classparent- The parser used in the default class
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
Fires whenever an XML start markup is encountered. It creates a new routePoint when a<rtept>markup is encountered.- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- 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- Any SAX exception, possibly wrapping another exception
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
Fires whenever an XML end markup is encountered. It catches attributes of routePoints or routes and saves them in corresponding values[].- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Parameters:
uri- URI of the local elementlocalName- Name of the local element (without prefix)qName- qName of the local element (with prefix)- Throws:
SAXException- Any SAX exception, possibly wrapping another exception
-
setParent
public void setParent(AbstractGpxParserDefault parent)
Set the parent of this specific parser.- Parameters:
parent-
-
isPoint
public boolean isPoint()
Indicates if we are in a point.- Returns:
- true if we are in a point, false else
-
setRteList
public void setRteList(List<org.locationtech.jts.geom.Coordinate> rteList)
Set the list corresponding to the points' coordinates of the actual route.- Parameters:
rteList-
-
-