本文整理了Java中com.google.gwt.user.server.rpc.RPC.getRpcVersion
方法的一些代码示例,展示了RPC.getRpcVersion
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RPC.getRpcVersion
方法的具体详情如下:
包路径:com.google.gwt.user.server.rpc.RPC
类名称:RPC
方法名:getRpcVersion
暂无
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Returns a string that encodes the results of an RPC call. Private overload
* that takes a flag signaling the preamble of the response payload.
*
* @param object the object that we wish to send back to the client
* @param wasThrown if true, the object being returned was an exception thrown
* by the service method; if false, it was the result of the service
* method's invocation
* @return a string that encodes the response from a service method
* @throws SerializationException if the object cannot be serialized
*/
private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
int flags, SerializationPolicy serializationPolicy) throws SerializationException {
ServerSerializationStreamWriter stream =
new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
stream.setFlags(flags);
stream.prepareToWrite();
if (responseClass != void.class) {
stream.serializeValue(object, responseClass);
}
String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
return bufferStr;
}
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Returns a string that encodes the results of an RPC call. Private overload
* that takes a flag signaling the preamble of the response payload.
*
* @param object the object that we wish to send back to the client
* @param wasThrown if true, the object being returned was an exception thrown
* by the service method; if false, it was the result of the service
* method's invocation
* @return a string that encodes the response from a service method
* @throws SerializationException if the object cannot be serialized
*/
private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
int flags, SerializationPolicy serializationPolicy) throws SerializationException {
ServerSerializationStreamWriter stream =
new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
stream.setFlags(flags);
stream.prepareToWrite();
if (responseClass != void.class) {
stream.serializeValue(object, responseClass);
}
String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
return bufferStr;
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Returns a string that encodes the results of an RPC call. Private overload
* that takes a flag signaling the preamble of the response payload.
*
* @param object the object that we wish to send back to the client
* @param wasThrown if true, the object being returned was an exception thrown
* by the service method; if false, it was the result of the service
* method's invocation
* @return a string that encodes the response from a service method
* @throws SerializationException if the object cannot be serialized
*/
private static String encodeResponse(Class<?> responseClass, Object object, boolean wasThrown,
int flags, SerializationPolicy serializationPolicy) throws SerializationException {
ServerSerializationStreamWriter stream =
new ServerSerializationStreamWriter(serializationPolicy, getRpcVersion());
stream.setFlags(flags);
stream.prepareToWrite();
if (responseClass != void.class) {
stream.serializeValue(object, responseClass);
}
String bufferStr = (wasThrown ? "//EX" : "//OK") + stream.toString();
return bufferStr;
}
内容来源于网络,如有侵权,请联系作者删除!