Class JsonImageDetectionDecoder
- java.lang.Object
-
- org.openstreetmap.josm.plugins.streetside.utils.api.JsonImageDetectionDecoder
-
public final class JsonImageDetectionDecoder extends java.lang.Object
Decodes the JSON returned byStreetsideURL.APIv3into Java objects. Takes aJsonObjectanddecodeImageDetection(JsonObject)tries to convert it to aImageDetection.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static org.apache.log4j.Loggerlogger
-
Constructor Summary
Constructors Modifier Constructor Description privateJsonImageDetectionDecoder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ImageDetectiondecodeImageDetection(javax.json.JsonObject json)private static java.awt.geom.Path2DdecodePolygon(javax.json.JsonArray json)Decodes a polygon (may be a multipolygon) from JSONprivate static java.awt.ShapedecodeShape(javax.json.JsonValue json)private static java.awt.geom.Path2DdecodeSimplePolygon(javax.json.JsonArray json)Decodes a simple polygon (consisting of only one continuous path) from JSON
-
-
-
Field Detail
-
logger
static final org.apache.log4j.Logger logger
-
-
Constructor Detail
-
JsonImageDetectionDecoder
private JsonImageDetectionDecoder()
-
-
Method Detail
-
decodeImageDetection
public static ImageDetection decodeImageDetection(javax.json.JsonObject json)
-
decodeShape
private static java.awt.Shape decodeShape(javax.json.JsonValue json)
-
decodePolygon
private static java.awt.geom.Path2D decodePolygon(javax.json.JsonArray json)
Decodes a polygon (may be a multipolygon) from JSON- Parameters:
json- the json array to decode, must not benull- Returns:
- the decoded polygon as
Path2D.Double
-
decodeSimplePolygon
private static java.awt.geom.Path2D decodeSimplePolygon(javax.json.JsonArray json)
Decodes a simple polygon (consisting of only one continuous path) from JSON- Parameters:
json- the json array to decode, must not benull- Returns:
- the decoded polygon as
Path2D.Double - Throws:
java.lang.NullPointerException- if parameter isnull
-
-