本文整理匯總了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;
}