Package io.atlasmap.json.service
Class JsonService
- java.lang.Object
-
- io.atlasmap.json.service.JsonService
-
@Path("/json/") public class JsonService extends ObjectThe JSON Service provides JSON inspection service which generate an AtlasMap Document object from JSON instance or JSON schema.
-
-
Constructor Summary
Constructors Constructor Description JsonService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcleanJsonData(String jsonData)Trims the String.protected <T> TfromJson(InputStream value, Class<T> clazz)Deserializes from a JSON.javax.ws.rs.core.Responseinspect(InputStream requestIn)Inspect a JSON schema or instance and return a Document object.StringsimpleHelloWorld(String from)Simple hello service.protected byte[]toJson(Object value)Serializes to a JSON.protected booleanvalidJsonData(String jsonData)Gets if the JSON data is valid.
-
-
-
Method Detail
-
toJson
protected byte[] toJson(Object value)
Serializes to a JSON.- Parameters:
value- value- Returns:
- serialized
-
fromJson
protected <T> T fromJson(InputStream value, Class<T> clazz)
Deserializes from a JSON.- Type Parameters:
T- type- Parameters:
value- valueclazz- type- Returns:
- deserialized
-
simpleHelloWorld
@GET @Path("/simple") @Produces("text/plain") public String simpleHelloWorld(@QueryParam("from") String from)Simple hello service.- Parameters:
from- sender- Returns:
- pong
-
inspect
@POST @Path("/inspect") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response inspect(InputStream requestIn)Inspect a JSON schema or instance and return a Document object.- Parameters:
requestIn- request- Returns:
JsonInspectionResponse
-
validJsonData
protected boolean validJsonData(String jsonData)
Gets if the JSON data is valid.- Parameters:
jsonData- json data- Returns:
- true if valid, or false
-
-