Example usage for org.springframework.integration.transformer MessageTransformationException MessageTransformationException

List of usage examples for org.springframework.integration.transformer MessageTransformationException MessageTransformationException

Introduction

In this page you can find the example usage for org.springframework.integration.transformer MessageTransformationException MessageTransformationException.

Prototype

public MessageTransformationException(String description) 

Source Link

Usage

From source file:org.springframework.cloud.stream.app.gemfire.JsonObjectTransformer.java

public PdxInstance toObject(String json) {
    JSONObject jsonObject = null;/*from  w w  w .  ja v  a 2 s.  c  o m*/
    try {
        jsonObject = new JSONObject(json);
    } catch (JSONException e) {
        throw new MessageTransformationException(e.getMessage());
    }
    return JSONFormatter.fromJSON(jsonObject.toString());
}

From source file:org.springframework.integration.x.gemfire.JsonStringToObjectTransformer.java

public PdxInstance transform(String json) {
    JSONObject jsonObject = null;/*w  w w  . ja va 2  s  . co m*/
    try {
        jsonObject = new JSONObject(json);
    } catch (JSONException e) {
        throw new MessageTransformationException(e.getMessage());
    }
    return JSONFormatter.fromJSON(jsonObject.toString());
}