Example usage for com.google.gson JsonSerializationContext serialize

List of usage examples for com.google.gson JsonSerializationContext serialize

Introduction

In this page you can find the example usage for com.google.gson JsonSerializationContext serialize.

Prototype

public JsonElement serialize(Object src, Type typeOfSrc);

Source Link

Document

Invokes default serialization on the specified object passing the specific type information.

Usage

From source file:org.cmg.jresp.json.GroupPredicateSerializer.java

License:Open Source License

private JsonElement doSerializeOrPredicate(Or src, JsonObject json, JsonSerializationContext context) {
    json.add("left", context.serialize(src.getLeft(), GroupPredicate.class));
    json.add("right", context.serialize(src.getRight(), GroupPredicate.class));
    return json;/* w  ww .j a v a 2s.  co m*/
}

From source file:org.eclipse.che.api.machine.server.recipe.adapters.GroupAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Group src, Type typeOfSrc, JsonSerializationContext context) {
    return context.serialize(src, GroupImpl.class);
}

From source file:org.eclipse.che.api.machine.server.recipe.adapters.PermissionsAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Permissions src, Type typeOfSrc, JsonSerializationContext context) {
    return context.serialize(src, PermissionsImpl.class);
}

From source file:org.eclipse.che.api.machine.server.recipe.adapters.RecipeTypeAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Recipe recipe, Type type, JsonSerializationContext context) {
    return context.serialize(recipe, RecipeImpl.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.CommandAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Command command, Type type, JsonSerializationContext context) {
    return context.serialize(command, CommandImpl.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.EnvironmentAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Environment src, Type type, JsonSerializationContext context) {
    return context.serialize(src, EnvironmentImpl.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.LimitsAdapter.java

License:Open Source License

@Override
public JsonElement serialize(Limits limits, Type type, JsonSerializationContext context) {
    return context.serialize(limits, Limits.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.MachineConfigAdapter.java

License:Open Source License

@Override
public JsonElement serialize(MachineConfig machineConfig, Type type, JsonSerializationContext context) {
    return context.serialize(machineConfig, MachineConfigImpl.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.MachineSourceAdapter.java

License:Open Source License

@Override
public JsonElement serialize(MachineSource machineSource, Type type, JsonSerializationContext context) {
    return context.serialize(machineSource, MachineSource.class);
}

From source file:org.eclipse.che.api.workspace.server.stack.adapters.ProjectConfigAdapter.java

License:Open Source License

@Override
public JsonElement serialize(ProjectConfig src, Type type, JsonSerializationContext context) {
    return context.serialize(src, ProjectConfigImpl.class);
}