Class GoogleJsonEngine
- java.lang.Object
-
- io.vertigo.vega.engines.webservice.json.GoogleJsonEngine
-
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,JsonEngine
public final class GoogleJsonEngine extends Object implements JsonEngine, io.vertigo.core.node.component.Activeable
- Author:
- pchretien, npiedeloup
-
-
Field Summary
-
Fields inherited from interface io.vertigo.vega.engines.webservice.json.JsonEngine
EXTENDED_VALUE_FIELDNAME, SERVER_SIDE_TOKEN_FIELDNAME
-
-
Constructor Summary
Constructors Constructor Description GoogleJsonEngine(Optional<Boolean> serializeNullsOpt, Optional<String> searchApiVersionStr, SmartTypeManager smartTypeManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <D> DfromJson(Reader jsonReader, Type paramType)Standard convert Json to object.<D> DfromJson(String json, Type paramType)Standard convert Json to object.voidstart()voidstop()StringtoJson(Object data)Standard convert full object to Json.StringtoJsonError(Throwable th)Convert Exception to JsonStringtoJsonWithMeta(Object data, Map<String,Serializable> metaDatas, Set<String> includedFields, Set<String> excludedFields)Convert object to Json but excluded fields.UiContextuiContextFromJson(String json, Map<String,Type> paramTypes)Specific convertion Json to UiContext.<D extends DtObject>
UiListDelta<D>uiListDeltaFromJson(String json, Type paramType)Specific convertion Json to UiListDelta.<D extends DtObject>
UiListModifiable<D>uiListFromJson(String json, Type paramType)Specific convertion Json to UiList.<D extends DtObject>
UiObject<D>uiObjectFromJson(String json, Type paramType)Specific convertion Json to UiObject.
-
-
-
Constructor Detail
-
GoogleJsonEngine
@Inject public GoogleJsonEngine(Optional<Boolean> serializeNullsOpt, Optional<String> searchApiVersionStr, SmartTypeManager smartTypeManager)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()
- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
toJson
public String toJson(Object data)
Standard convert full object to Json.- Specified by:
toJsonin interfaceJsonEngine- Parameters:
data- Object- Returns:
- Json string
-
toJsonWithMeta
public String toJsonWithMeta(Object data, Map<String,Serializable> metaDatas, Set<String> includedFields, Set<String> excludedFields)
Convert object to Json but excluded fields.- Specified by:
toJsonWithMetain interfaceJsonEngine- Parameters:
data- ObjectmetaDatas- metaDatas to include in JsonincludedFields- Set of fields to include (empty means all fields include)excludedFields- Set of fields to exclude- Returns:
- Json string
-
toJsonError
public String toJsonError(Throwable th)
Convert Exception to Json- Specified by:
toJsonErrorin interfaceJsonEngine- Parameters:
th- Throwable- Returns:
- Json string
-
fromJson
public <D> D fromJson(String json, Type paramType)
Standard convert Json to object. While converting accept missing object fields and unknown object fields (and then just forgot json value)- Specified by:
fromJsonin interfaceJsonEngine- Type Parameters:
D- Object type- Parameters:
json- Json stringparamType- Object type- Returns:
- Object filled with json typed data
-
fromJson
public <D> D fromJson(Reader jsonReader, Type paramType)
Standard convert Json to object. While converting accept missing object fields and unknown object fields (and then just forgot json value)- Specified by:
fromJsonin interfaceJsonEngine- Type Parameters:
D- Object type- Parameters:
jsonReader- ReaderparamType- Object type- Returns:
- Object filled with json typed data
-
uiObjectFromJson
public <D extends DtObject> UiObject<D> uiObjectFromJson(String json, Type paramType)
Specific convertion Json to UiObject. UiObject is used as a buffer from client input. While converting accept missing object fields and unknown object fields (and then just forgot json value)- Specified by:
uiObjectFromJsonin interfaceJsonEngine- Type Parameters:
D- Object type- Parameters:
json- Json stringparamType- Object type- Returns:
- UiObject filled with a DtObject partially filled and the accessToken if present
-
uiListDeltaFromJson
public <D extends DtObject> UiListDelta<D> uiListDeltaFromJson(String json, Type paramType)
Specific convertion Json to UiListDelta.- Specified by:
uiListDeltaFromJsonin interfaceJsonEngine- Type Parameters:
D- Object type- Parameters:
json- Json stringparamType- Object type- Returns:
- UiListDelta filled with created/updated/deleted DtObjects list partially filled and the accessToken if present
-
uiListFromJson
public <D extends DtObject> UiListModifiable<D> uiListFromJson(String json, Type paramType)
Specific convertion Json to UiList.- Specified by:
uiListFromJsonin interfaceJsonEngine- Type Parameters:
D- Object type- Parameters:
json- Json stringparamType- Object type- Returns:
- UiList filled with DtObjects list partially filled and the accessToken if present
-
uiContextFromJson
public UiContext uiContextFromJson(String json, Map<String,Type> paramTypes)
Specific convertion Json to UiContext. UiContext is used as a buffer from client input- Specified by:
uiContextFromJsonin interfaceJsonEngine- Parameters:
json- Json stringparamTypes- Objects type- Returns:
- UiContext filled with a DtObject partially filled and the accessTOken if present
-
-