本文整理汇总了Java中org.jboss.errai.marshalling.server.ServerMarshalling类的典型用法代码示例。如果您正苦于以下问题:Java ServerMarshalling类的具体用法?Java ServerMarshalling怎么用?Java ServerMarshalling使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServerMarshalling类属于org.jboss.errai.marshalling.server包,在下文中一共展示了ServerMarshalling类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: read
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
public <T> T read(final String path) {
Path fsPath = fileSystem.getPath(path);
try {
if (ioService.exists(fsPath)) {
String content = ioService.readAllString(fsPath);
return (T) ServerMarshalling.fromJSON(content);
}
} catch (final Exception e) {
throw new RuntimeException(e);
}
return null;
}
示例2: write
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
public <T> void write(final String path,
final T value) {
try {
ioService.startBatch(fileSystem);
Path fsPath = fileSystem.getPath(path);
String content = ServerMarshalling.toJSON(value);
ioService.write(fsPath,
content);
} catch (final Exception e) {
throw new RuntimeException(e);
} finally {
ioService.endBatch();
}
}
示例3: check
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
private void check(final Issue original,
final Issue secondOne) {
final String json = ServerMarshalling.toJSON(original);
final Issue newVersion = (Issue) ServerMarshalling.fromJSON(json);
assertEquals(original.hashCode(),
newVersion.hashCode());
assertNotEquals(secondOne.hashCode(),
newVersion.hashCode());
}
示例4: unmarshall
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Graph unmarshall(final Metadata metadata,
final InputStream input) throws IOException {
Graph result = (Graph) ServerMarshalling.fromJSON(input);
return result;
}
示例5: unmarshallFromStunnerJSON
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Deprecated
public Graph unmarshallFromStunnerJSON(final Metadata metadata,
final InputStream input) throws IOException {
Graph result = (Graph) ServerMarshalling.fromJSON(input);
return result;
}
示例6: marshallFromStunnerToJSON
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Deprecated
public String marshallFromStunnerToJSON(final Diagram<Graph, Metadata> diagram) throws IOException {
String result = ServerMarshalling.toJSON(diagram.getGraph());
return result;
}
示例7: marshall
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public String marshall(final Diagram<Graph, Metadata> diagram) throws IOException {
String result = ServerMarshalling.toJSON(diagram.getGraph());
return result;
}
示例8: unmarshall
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
public Metadata unmarshall(final InputStream input) throws IOException {
Metadata result = (Metadata) ServerMarshalling.fromJSON(input);
return result;
}
示例9: marshall
import org.jboss.errai.marshalling.server.ServerMarshalling; //导入依赖的package包/类
@Override
public String marshall(final Metadata metadata) throws IOException {
String result = ServerMarshalling.toJSON(metadata);
return result;
}