Search in sources :

Example 1 with JsonReader

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);
}
Also used : JsonReader(com.robo4j.socket.http.json.JsonReader) JsonDocument(com.robo4j.socket.http.json.JsonDocument)

Example 2 with JsonReader

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);
}
Also used : JsonReader(com.robo4j.socket.http.json.JsonReader) HttpPathMethodDTO(com.robo4j.socket.http.dto.HttpPathMethodDTO) JsonDocument(com.robo4j.socket.http.json.JsonDocument)

Aggregations

JsonDocument (com.robo4j.socket.http.json.JsonDocument)2 JsonReader (com.robo4j.socket.http.json.JsonReader)2 HttpPathMethodDTO (com.robo4j.socket.http.dto.HttpPathMethodDTO)1