org.openstreetmap.josm.plugins.streetside.utils.api

## 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 by `StreetsideURL.APIv3` into Java objects. Takes a `JsonObject` and `decodeImageDetection(JsonObject)` tries to convert it to a `ImageDetection`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static org.apache.log4j.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `JsonImageDetectionDecoder()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ImageDetection` | `decodeImageDetection(javax.json.JsonObject json)`
    `private static java.awt.geom.Path2D` | `decodePolygon(javax.json.JsonArray json)` Decodes a polygon (may be a multipolygon) from JSON
    `private static java.awt.Shape` | `decodeShape(javax.json.JsonValue json)`
    `private static java.awt.geom.Path2D` | `decodeSimplePolygon(javax.json.JsonArray json)` Decodes a simple polygon (consisting of only one continuous path) from JSON

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 be `null`
      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 be `null`
      Returns:
        the decoded polygon as `Path2D.Double`
      Throws:
        `java.lang.NullPointerException` - if parameter is `null`

JOSM Plugins