@Component(value="cuba_ViewSerialization") public class ViewSerialization extends java.lang.Object implements ViewSerializationAPI
Modifier and Type | Class and Description |
---|---|
protected class |
ViewSerialization.ViewDeserializer |
protected class |
ViewSerialization.ViewSerializer |
Modifier and Type | Field and Description |
---|---|
protected Metadata |
metadata |
NAME
Constructor and Description |
---|
ViewSerialization() |
Modifier and Type | Method and Description |
---|---|
protected com.google.gson.Gson |
createGson(ViewSerializationOption... options) |
protected View |
findProcessedView(java.util.Collection<View> processedViews,
java.lang.Class<? extends Entity> aClass,
java.lang.String viewName) |
View |
fromJson(java.lang.String json)
Deserializes a JSON object to view.
|
java.lang.String |
toJson(View view,
ViewSerializationOption... options)
Serializes a view to JSON object
|
@Inject protected Metadata metadata
public View fromJson(java.lang.String json)
ViewSerializationAPI
ViewSerializationOption.COMPACT_FORMAT
option.fromJson
in interface ViewSerializationAPI
json
- JSON objects that represents the viewpublic java.lang.String toJson(View view, ViewSerializationOption... options)
ViewSerializationAPI
toJson
in interface ViewSerializationAPI
view
- a viewoptions
- options specifying how a JSON object graph should be serializedprotected com.google.gson.Gson createGson(ViewSerializationOption... options)