本文整理汇总了Java中com.google.gwt.user.client.rpc.impl.AbstractSerializationStream类的典型用法代码示例。如果您正苦于以下问题:Java AbstractSerializationStream类的具体用法?Java AbstractSerializationStream怎么用?Java AbstractSerializationStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractSerializationStream类属于com.google.gwt.user.client.rpc.impl包,在下文中一共展示了AbstractSerializationStream类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testElision
import com.google.gwt.user.client.rpc.impl.AbstractSerializationStream; //导入依赖的package包/类
public void testElision() throws SerializationException {
ObjectGraphTestServiceAsync async = getServiceAsync();
SerializationStreamWriter writer = ((SerializationStreamFactory) async)
.createStreamWriter();
AbstractSerializationStream stream = (AbstractSerializationStream) writer;
assertEquals(
"Missing flag",
expectedObfuscationState(),
stream.hasFlags(AbstractSerializationStream.FLAG_ELIDE_TYPE_NAMES));
SerializableDoublyLinkedNode node = new SerializableDoublyLinkedNode();
writer.writeObject(node);
String s = writer.toString();
// Don't use class.getName() due to conflict with removal of type names
assertEquals("Checking for SerializableDoublyLinkedNode",
expectedObfuscationState(),
!s.contains("SerializableDoublyLinkedNode"));
}
示例2: serialize
import com.google.gwt.user.client.rpc.impl.AbstractSerializationStream; //导入依赖的package包/类
public <T> String serialize(Class<? super T> clazz, T instance, SerializationPolicy serializationPolicy) throws SerializationException {
if (instance == null) {
return null;
}else if(String.class.equals(clazz)){
return (String) instance;
}
if (serializationPolicy == null) {
throw new IllegalArgumentException("SerializationPolicy is null, please call StorageUtils.PolicyLoader.load(...) before");
}
ServerSerializationStreamWriter stream = new ServerSerializationStreamWriter(serializationPolicy);
stream.setFlags(AbstractSerializationStream.DEFAULT_FLAGS);
stream.prepareToWrite();
if (clazz != void.class) {
stream.serializeValue(instance, clazz);
}
return stream.toString();
}
示例3: invokeAndEncodeResponse
import com.google.gwt.user.client.rpc.impl.AbstractSerializationStream; //导入依赖的package包/类
public static String invokeAndEncodeResponse(Object target,
Method serviceMethod,
Object[] args,
SerializationPolicy serializationPolicy)
throws SerializationException {
return invokeAndEncodeResponse(target, serviceMethod, args, serializationPolicy,
AbstractSerializationStream.DEFAULT_FLAGS);
}
示例4: invokeAndEncodeResponse
import com.google.gwt.user.client.rpc.impl.AbstractSerializationStream; //导入依赖的package包/类
public static String invokeAndEncodeResponse(Object target, Method serviceMethod, Object[] args,
SerializationPolicy serializationPolicy) throws SerializationException {
return invokeAndEncodeResponse(target, serviceMethod, args, serializationPolicy,
AbstractSerializationStream.DEFAULT_FLAGS);
}