use of com.robo4j.socket.http.json.JsonReader in project robo4j by Robo4J.
the class AbstractHttpMessageCodec method decode.
@Override
public T decode(String json) {
JsonReader jsonReader = new JsonReader(json);
JsonDocument document = jsonReader.read();
return ReflectUtils.createInstanceByClazzAndDescriptorAndJsonDocument(clazz, document);
}
use of com.robo4j.socket.http.json.JsonReader in project robo4j by Robo4J.
the class HttpPathUtils method readServerPathDTO.
/**
* parse json string to mutable path properties
*
* @param configurationJson
* configuration json
* @return return server path dto with method and possible properties
*/
public static HttpPathMethodDTO readServerPathDTO(String configurationJson) {
Class<HttpPathMethodDTO> clazz = HttpPathMethodDTO.class;
JsonReader jsonReader = new JsonReader(configurationJson);
JsonDocument document = jsonReader.read();
return ReflectUtils.createInstanceByClazzAndDescriptorAndJsonDocument(clazz, document);
}
Aggregations