Class AbstractGpxParserDefault

    • Constructor Detail

      • AbstractGpxParserDefault

        public AbstractGpxParserDefault​(Connection connection,
                                        File fileName,
                                        String encoding,
                                        boolean deleteTable)
    • Method Detail

      • clear

        public void clear()
        Initialisation of all the indicators used to read the document.
      • read

        public String[] read​(String tableName,
                             org.h2gis.api.ProgressVisitor progress)
                      throws SQLException,
                             FileNotFoundException
        Reads the document and parses it.The other methods are called automatically when corresponding markup is found.
        Parameters:
        tableName - the table used to create all tables
        progress -
        Returns:
        a boolean value if the parser ends successfully or not
        Throws:
        SQLException - if the creation of the tables failed
        FileNotFoundException
      • 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:
        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)
        Fires whenever an XML end markup is encountered. It catches attributes of the different elements 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)
      • getTime

        public String getTime()
        Gives the date when this file is created.
        Returns:
      • getVersion

        public String getVersion()
        Gives the version number of the GPX document.
        Returns:
      • getCreator

        public String getCreator()
        Gives the name or URL of the software that created the GPX document.
        Returns:
      • getMinLon

        public double getMinLon()
        Gives the minimum longitude given by <bounds> element.
        Returns:
      • getMaxLon

        public double getMaxLon()
        Gives the maximum longitude given by <bounds> element.
        Returns:
      • getMinLat

        public double getMinLat()
        Gives the minimum latitude given by <bounds> element.
        Returns:
      • getMaxLat

        public double getMaxLat()
        Gives the maximum latitude given by <bounds> element.
        Returns:
      • getDesc

        public String getDesc()
        Gives a description of the contents of the GPX file.
        Returns:
      • getKeywords

        public String getKeywords()
        Gives keywords associated with the file. Search engines or databases can use this information to classify the data.
        Returns:
      • getFullLink

        public String getFullLink()
        Gives URLs associated with the location described in the file.
        Returns:
      • getFullAuthor

        public String getFullAuthor()
        Gives the name of person or organization who created the GPX file. Also gives an email address if exist. Also gives a link to Web site or other external information about person if exist.
        Returns:
      • setAuthorLink

        public void setAuthorLink​(String authorLink)
        Set the link related to the author of the ducument.
        Parameters:
        authorLink -
      • setAuthorLinkText

        public void setAuthorLinkText​(String authorLinkText)
        Set the description of the link related to the author.
        Parameters:
        authorLinkText -
      • setAuthorName

        public void setAuthorName​(String authorName)
        Set the name of the author of the document.
        Parameters:
        authorName -
      • setEmail

        public void setEmail​(String email)
        Set the email of the author of the document.
        Parameters:
        email -
      • setLink

        public void setLink​(String link)
        Set the link related to the document.
        Parameters:
        link -
      • setLinkText

        public void setLinkText​(String linkText)
        Set the description of hte document link.
        Parameters:
        linkText -
      • getName

        public String getName()
        Gives the name of the document.
        Returns:
      • setName

        public void setName​(String name)
        Set the name of the document.
        Parameters:
        name -
      • getWptParser

        public AbstractGpxParserWpt getWptParser()
        Gives the parser used to parse waypoint.
        Returns:
      • setWptParser

        public void setWptParser​(AbstractGpxParserWpt wptParser)
        Set the parser used to parse waypoint.
        Parameters:
        wptParser -
      • setRteParser

        public void setRteParser​(AbstractGpxParserRte rteParser)
        Set the parser used to parse routes.
        Parameters:
        rteParser -
      • getRteParser

        public AbstractGpxParserRte getRteParser()
        Gives the parser used to parse routes.
        Returns:
      • setTrkParser

        public void setTrkParser​(AbstractGpxParserTrk trkParser)
        Set the parser used to parse the track
        Parameters:
        trkParser -
      • getTrkParser

        public AbstractGpxParserTrk getTrkParser()
        Givers the parser used to parse the track
        Returns: