Package org.openstreetmap.josm.io
Class OsmServerObjectReader
java.lang.Object
org.openstreetmap.josm.io.OsmConnection
org.openstreetmap.josm.io.OsmServerReader
org.openstreetmap.josm.io.OsmServerObjectReader
OsmServerObjectReader reads an individual object from the OSM server.
It can either download the object including or not including its immediate children.
The former case is called a "full download".
It can also download a specific version of the object (however, "full" download is not possible
in that case).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmServerReader
OsmServerReader.DomParser<R> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleantrue if a full download is required, i.e.private final PrimitiveIdthe id of the object to downloadprivate final intthe specific version number, if required (incompatible with full), or -1 elseFields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperlyFields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, oAuth20Parameters -
Constructor Summary
ConstructorsModifierConstructorDescriptionOsmServerObjectReader(long id, OsmPrimitiveType type, boolean full) Creates a new server object reader for a given id and a primitive type.protectedOsmServerObjectReader(long id, OsmPrimitiveType type, boolean full, int version) OsmServerObjectReader(long id, OsmPrimitiveType type, int version) Creates a new server object reader for a given id and a primitive type.OsmServerObjectReader(PrimitiveId id, boolean full) Creates a new server object reader for an object with the givenidprotectedOsmServerObjectReader(PrimitiveId id, boolean full, int version) OsmServerObjectReader(PrimitiveId id, int version) Creates a new server object reader for an object with the givenid -
Method Summary
Modifier and TypeMethodDescriptionparseOsm(ProgressMonitor progressMonitor) Downloads and parses the data.Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
adaptRequest, fetchData, getAttribute, getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseNotes, parseOsm, parseOsmChange, parseOsmChange, parseRawGps, parseRawGps, parseRawNotes, parseRawNotes, setDoAuthenticateMethods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin
-
Field Details
-
id
the id of the object to download -
full
true if a full download is required, i.e. a download including the immediate children -
version
the specific version number, if required (incompatible with full), or -1 else
-
-
Constructor Details
-
OsmServerObjectReader
Creates a new server object reader for a given id and a primitive type.- Parameters:
id- the object id. > 0 required.type- the type. Must not be null.full- true, if a full download is requested (i.e. a download including immediate children); false, otherwise- Throws:
IllegalArgumentException- if id <= 0IllegalArgumentException- if type is null
-
OsmServerObjectReader
Creates a new server object reader for a given id and a primitive type.- Parameters:
id- the object id. > 0 required.type- the type. Must not be null.version- the specific version number, if required; -1, otherwise- Throws:
IllegalArgumentException- if id <= 0IllegalArgumentException- if type is null
-
OsmServerObjectReader
-
OsmServerObjectReader
Creates a new server object reader for an object with the givenid- Parameters:
id- the object id. Must not be null. Unique id > 0 required.full- true, if a full download is requested (i.e. a download including immediate children); false, otherwise- Throws:
IllegalArgumentException- if id is nullIllegalArgumentException- if id.getUniqueId() <= 0
-
OsmServerObjectReader
Creates a new server object reader for an object with the givenid- Parameters:
id- the object id. Must not be null. Unique id > 0 required.version- the specific version number, if required; -1, otherwise- Throws:
IllegalArgumentException- if id is nullIllegalArgumentException- if id.getUniqueId() <= 0
-
OsmServerObjectReader
-
-
Method Details
-
parseOsm
Downloads and parses the data.- Specified by:
parseOsmin classOsmServerReader- Parameters:
progressMonitor- the progress monitor. Set toNullProgressMonitor.INSTANCEif null- Returns:
- the downloaded data
- Throws:
OsmTransferException- if any error occurs during dialog with OSM API
-