java.lang.Object
io.ebean.text.json.JsonWriteOptions
Provides options for customising the JSON write process.
You can explicitly state which properties to include in the JSON output for the root level and each path.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JsonConfig.Includeprotected booleanprotected Objectprotected FetchPathprotected Map<String, JsonWriteBeanVisitor<?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the include mode for this request.Return the jackson object mapper to use.Return the properties to include by path.Return the Map of registered JsonWriteBeanVisitor's by path.booleanShould loaded properties be included implicit, if no other fetch path is specified (default = true).static JsonWriteOptionsParse and return a PathProperties from nested string format like (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a path containing "g" and the root path contains "a","b","c" and "f".static JsonWriteOptionspathProperties(FetchPath pathProperties) Construct JsonWriteOptions with the given pathProperties.voidsetInclude(JsonConfig.Include include) Set the include mode for this request.voidsetIncludeLoadedImplicit(boolean includeLoadedImplicit) Set include loaded properties implicit (default = true).voidsetObjectMapper(Object objectMapper) Set the jackson object mapper to use.voidsetPathProperties(FetchPath pathProperties) Set the Map of properties to include by path.setPathVisitor(String path, JsonWriteBeanVisitor<?> visitor) Register a JsonWriteBeanVisitor for the given path.setRootPathVisitor(JsonWriteBeanVisitor<?> visitor) Register a JsonWriteBeanVisitor for the root level.
-
Field Details
-
pathProperties
-
objectMapper
-
include
-
includeLoadedImplicit
protected boolean includeLoadedImplicit -
visitorMap
-
-
Constructor Details
-
JsonWriteOptions
public JsonWriteOptions()
-
-
Method Details
-
parsePath
Parse and return a PathProperties from nested string format like (a,b,c(d,e),f(g)) where "c" is a path containing "d" and "e" and "f" is a path containing "g" and the root path contains "a","b","c" and "f".- See Also:
-
pathProperties
Construct JsonWriteOptions with the given pathProperties. -
setPathProperties
Set the Map of properties to include by path. -
getPathProperties
Return the properties to include by path. -
getInclude
Return the include mode for this request. -
setInclude
Set the include mode for this request. -
isIncludeLoadedImplicit
public boolean isIncludeLoadedImplicit()Should loaded properties be included implicit, if no other fetch path is specified (default = true). -
setIncludeLoadedImplicit
public void setIncludeLoadedImplicit(boolean includeLoadedImplicit) Set include loaded properties implicit (default = true). -
setRootPathVisitor
Register a JsonWriteBeanVisitor for the root level. -
setPathVisitor
Register a JsonWriteBeanVisitor for the given path. -
getVisitorMap
Return the Map of registered JsonWriteBeanVisitor's by path. -
getObjectMapper
Return the jackson object mapper to use. If null the ObjectMapper from DatabaseConfig will be used. -
setObjectMapper
Set the jackson object mapper to use. If null the ObjectMapper from DatabaseConfig will be used.
-