org.h2gis.drivers.gpx.model
Class AbstractGpxParserTrk

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.h2gis.drivers.gpx.model.AbstractGpxParser
          extended by org.h2gis.drivers.gpx.model.AbstractGpxParserTrk
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler
Direct Known Subclasses:
GpxParserTrk

public abstract class AbstractGpxParserTrk
extends AbstractGpxParser

Abstract class of the parsers dedicated to tracks. A specific parser for version 1.0 and version 1.1 will extend this class.

Author:
Erwan Bocher and Antonin Piasco

Constructor Summary
AbstractGpxParserTrk()
           
 
Method Summary
 void endElement(String uri, String localName, String qName)
          Fires whenever an XML end markup is encountered.
 void initialise(XMLReader reader, AbstractGpxParserDefault parent)
          Create a new specific parser.
 boolean isPoint()
          Indicates if we are in a point.
 void setParent(AbstractGpxParserDefault parent)
          Set the parent of this specific parser.
 void setTrkList(List<com.vividsolutions.jts.geom.LineString> trkList)
          Set the list corresponding to the segments' list of coordinates of the actual track.
 void setTrksegList(List<com.vividsolutions.jts.geom.Coordinate> trksegList)
          Set the list corresponding to the points' coordinates of the actual track segment.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Fires whenever an XML start markup is encountered.
 
Methods inherited from class org.h2gis.drivers.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGpxParserTrk

public AbstractGpxParserTrk()
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 trkID.

Parameters:
reader - The XMLReader used in the default class
parent - 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 trackSegment when a markup is encountered. It creates a new trackPoint when a markup is encountered. It saves informations about in currentPoint or currentLine.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri - URI of the local element
localName - 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 trackPoints, trackSegments or routes and saves them in corresponding values[].

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
uri - URI of the local element
localName - 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

setTrkList

public void setTrkList(List<com.vividsolutions.jts.geom.LineString> trkList)
Set the list corresponding to the segments' list of coordinates of the actual track.

Parameters:
trkList -

setTrksegList

public void setTrksegList(List<com.vividsolutions.jts.geom.Coordinate> trksegList)
Set the list corresponding to the points' coordinates of the actual track segment.

Parameters:
trksegList -


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.