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 Object

  Decodes the JSON returned by `StreetsideURL.APIv3` into Java objects. Takes a `JsonObject` and `decodeImageDetection(JsonObject)` tries to convert it to a `ImageDetection`.

- - ### 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 Path2D` | `decodePolygon(javax.json.JsonArray json)` Decodes a polygon (may be a multipolygon) from JSON
    `private static Shape` | `decodeShape(javax.json.JsonValue json)`
    `private static 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`

- - ### Constructor Detail

    - #### JsonImageDetectionDecoder

          private JsonImageDetectionDecoder()

  - ### Method Detail

    - #### decodeImageDetection

          public static ImageDetection decodeImageDetection(javax.json.JsonObject json)

    - #### decodeShape

          private static Shape decodeShape(javax.json.JsonValue json)

    - #### decodePolygon

          private static 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 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:
        `NullPointerException` - if parameter is `null`

JOSM Plugins