本文整理汇总了Java中org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper.fromJSON方法的典型用法代码示例。如果您正苦于以下问题:Java MarshallingWrapper.fromJSON方法的具体用法?Java MarshallingWrapper.fromJSON怎么用?Java MarshallingWrapper.fromJSON使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper
的用法示例。
在下文中一共展示了MarshallingWrapper.fromJSON方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: received
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入方法依赖的package包/类
private void received(final String json) {
try {
LOGGER.finest("Receiving: " + json);
final Object o = MarshallingWrapper.fromJSON(json);
if (o instanceof WebWorkerLogMessage) {
LOGGER.info("Web Worker log message: " + ((WebWorkerLogMessage) o).getMessage());
} else if (o instanceof WebWorkerException) {
LOGGER.severe("Web Worker failed: " + ((WebWorkerException) o).getMessage());
} else if (o instanceof Status) {
reporter.sendStatus((Status) o);
} else if (o instanceof Issues) {
reporter.sendReport(new HashSet<>(((Issues) o).getSet()));
}
} catch (Exception e) {
LOGGER.severe("Could not manage received json: " + e.getMessage()
+ " JSON: " + json);
}
}
示例2: onResponseReceived
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onResponseReceived(Request request, Response response) {
String result = response.getText();
List<R> responseObject = (List<R>) MarshallingWrapper.fromJSON(result, List.class, typeParameterClass);
if (responseObject != null) {
execute(responseObject);
}
}
示例3: onResponseReceived
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onResponseReceived(Request request, Response response) {
String result = response.getText();
R responseObject = (R) MarshallingWrapper.fromJSON(result, typeParameterClass);
if (responseObject != null) {
execute(responseObject);
}
}
示例4: received
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入方法依赖的package包/类
public void received( final String json ) {
Object o = null;
try {
o = MarshallingWrapper.fromJSON( json );
} catch ( final Exception e ) {
error( "Failed to create and object out of the following JSON: " + json );
}
if ( o != null ) {
receiver.received( o );
}
}
示例5: error
import org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper; //导入方法依赖的package包/类
@Override
public boolean error(Request message, Throwable throwable) {
try {
throw throwable;
} catch (ResponseException e) {
Response response = e.getResponse();
RestServiceException exception = MarshallingWrapper.fromJSON(response.getText(), RestServiceException.class);
exception(exception);
} catch (Throwable t) {
Window.alert(t.getMessage());
}
return false;
}