java.lang.Object
io.jenetics.jpx.GPX.Reader
- Enclosing class:
- GPX
Class for reading GPX files. A reader instance can be created by the
GPX.reader factory methods.- Since:
- 1.3
- Version:
- 3.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GPX.ReaderThe default GPX reader, reading GPX files (v1.1) with reading modeGPX.Reader.Mode.STRICT. -
Method Summary
Modifier and TypeMethodDescriptionfromString(String xml) Create a GPX object from the given GPX-XML string.mode()Return the current reader mode.static GPX.Readerof(GPX.Reader.Mode mode) Return a GPX reader, reading GPX files with version 1.1 and in the given reading mode.static GPX.Readerof(GPX.Version version, GPX.Reader.Mode mode) Return a GPX reader, reading GPX files with the given version and in the given reading mode.Read a GPX object from the givenfile.read(InputStream input) Read a GPX object from the giveninputstream.Read a GPX object from the givenpath.Read a GPX object from the givenpath.Read a GPX object from the given inputsource.version()Return the GPX versionthisreader is able to read.
-
Field Details
-
DEFAULT
The default GPX reader, reading GPX files (v1.1) with reading modeGPX.Reader.Mode.STRICT.- Since:
- 3.0
-
-
Method Details
-
version
Return the GPX versionthisreader is able to read.- Returns:
- the GPX version of
thisreader
-
mode
Return the current reader mode.- Returns:
- the current reader mode
-
read
Read a GPX object from the given inputsource. This is the most general method for reading aGPXobject.- Parameters:
source- the input source from where the GPX date is read- Returns:
- the GPX object read from the source
- Throws:
IOException- if the GPX object can't be readNullPointerException- if the givensourceisnullInvalidObjectException- if the gpx input is invalid.UnsupportedOperationException- if the definedXMLInputFactorydoesn't support the givensource- Since:
- 3.0
-
read
Read a GPX object from the giveninputstream.- Parameters:
input- the input stream from where the GPX date is read- Returns:
- the GPX object read from the in stream
- Throws:
IOException- if the GPX object can't be readNullPointerException- if the giveninputstream isnullInvalidObjectException- if the gpx input is invalid.
-
read
Read a GPX object from the givenpath.- Parameters:
path- the input path from where the GPX date is read- Returns:
- the GPX object read from the input stream
- Throws:
IOException- if the GPX object can't be readNullPointerException- if the giveninputstream isnullInvalidObjectException- if the gpx input is invalid.
-
read
Read a GPX object from the givenfile.- Parameters:
file- the input file from where the GPX date is read- Returns:
- the GPX object read from the input stream
- Throws:
IOException- if the GPX object can't be readNullPointerException- if the giveninputstream isnullInvalidObjectException- if the gpx input is invalid.
-
read
Read a GPX object from the givenpath.- Parameters:
path- the input path from where the GPX date is read- Returns:
- the GPX object read from the input stream
- Throws:
IOException- if the GPX object can't be readNullPointerException- if the giveninputstream isnullInvalidObjectException- if the gpx input is invalid.
-
fromString
Create a GPX object from the given GPX-XML string.- Parameters:
xml- the GPX XML string- Returns:
- the GPX object created from the given XML string
- Throws:
IllegalArgumentException- if the givenxmlis not a valid GPX XML stringNullPointerException- if the givenxmlstring isnull- See Also:
-
of
Return a GPX reader, reading GPX files with the given version and in the given reading mode.- Parameters:
version- the GPX version to readmode- the reading mode- Returns:
- a new GPX reader object
- Throws:
NullPointerException- if one of the arguments isnull- Since:
- 3.0
-
of
Return a GPX reader, reading GPX files with version 1.1 and in the given reading mode.- Parameters:
mode- the reading mode- Returns:
- a new GPX reader object
- Throws:
NullPointerException- if one of the arguments isnull- Since:
- 3.0
-