/** * Uses the configured {@link ClientExceptionMapper} to unmarshal the * {@link Response} into a {@link Throwable}. * * @param response */ protected Throwable unmarshallException(final Response response) { return getExceptionMapper().fromResponse(response); }
/** * @return true if this proxy has a configured exception mapper */ public boolean hasExceptionMapper() { return getExceptionMapper() != null; }
public static Object fromJSON(final String json) { return marshaller.fromJSON(json); } }
protected String getJsonModel(ScenarioSimulationModel model) { return MarshallingWrapper.toJSON(model); }
private String _fromJSON(final String json) { if (RestClient.isJacksonMarshallingActive()) { return JacksonTransformer.fromJackson(json); } return json; } };
private String _toJSON(final String json) { if (RestClient.isJacksonMarshallingActive()) { return JacksonTransformer.toJackson(json); } return json; }
public static String toJSON(final Map<Object, Object> obj) { return marshaller.toJSON(obj); }
@Override public String toJSON(Map<Object, Object> obj) { return _toJSON(Marshalling.toJSON(obj)); }
@SuppressWarnings({ "rawtypes" }) protected void sendRequest(final RequestBuilder requestBuilder, final String body, final ResponseDemarshallingCallback demarshallingCallback) { sendRequest(requestBuilder, body, demarshallingCallback, true); }
@Override public void onError(final Request request, final Throwable throwable) { handleError(throwable, request, null); }
@Override public void onModuleLoad() { JaxrsProxyLoader proxyLoader = GWT.create(JaxrsProxyLoader.class); proxyLoader.loadProxies(); } }
/** * Call this method to unmarshal the REST error response to a Bean of a * particular type. * @param response * @param type */ protected <T> T fromJSON(final Response response, final Class<T> type) { return MarshallingWrapper.fromJSON(response.getText(), type); }
@SuppressWarnings("unchecked") @Override public <K, V> Map<K, V> fromJSON(String json, Class<?> type, Class<K> mapKeyType, Class<V> mapValueType) { return (Map<K, V>) Marshalling.fromJSON(_fromJSON(json), type, mapKeyType, mapValueType); }
public static <T> T fromJSON(final String json, final Class<T> type, final Class<?> elementType) { return marshaller.fromJSON(json, type, elementType); }
public static String toJSON(final Object obj) { return marshaller.toJSON(obj); }
@Override public String toJSON(Object obj) { return _toJSON(Marshalling.toJSON(obj)); }
public static <T> T fromJSON(final String json, final Class<T> type) { return marshaller.fromJSON(json, type); }
public static String toJSON(final List<?> arr) { return marshaller.toJSON(arr); }
public static <K, V> Map<K, V> fromJSON(final String json, final Class<?> type, final Class<K> mapKeyType, final Class<V> mapValueType) { return marshaller.fromJSON(json, type, mapKeyType, mapValueType); }