Package io.ebean.text.json
Class JsonWriteOptions
- java.lang.Object
-
- io.ebean.text.json.JsonWriteOptions
-
public class JsonWriteOptions extends Object
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.
-
-
Constructor Summary
Constructors Constructor Description JsonWriteOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonConfig.IncludegetInclude()Return the include mode for this request.ObjectgetObjectMapper()Return the jackson object mapper to use.FetchPathgetPathProperties()Return the properties to include by path.Map<String,JsonWriteBeanVisitor<?>>getVisitorMap()Return the Map of registered JsonWriteBeanVisitor's by path.static JsonWriteOptionsparsePath(String pathProperties)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".static JsonWriteOptionspathProperties(FetchPath pathProperties)Construct JsonWriteOptions with the given pathProperties.voidsetInclude(JsonConfig.Include include)Set the include mode for this request.voidsetObjectMapper(Object objectMapper)Set the jackson object mapper to use.voidsetPathProperties(FetchPath pathProperties)Set the Map of properties to include by path.JsonWriteOptionssetPathVisitor(String path, JsonWriteBeanVisitor<?> visitor)Register a JsonWriteBeanVisitor for the given path.JsonWriteOptionssetRootPathVisitor(JsonWriteBeanVisitor<?> visitor)Register a JsonWriteBeanVisitor for the root level.
-
-
-
Constructor Detail
-
JsonWriteOptions
public JsonWriteOptions()
-
-
Method Detail
-
parsePath
public static JsonWriteOptions parsePath(String pathProperties)
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.parse(String)
-
pathProperties
public static JsonWriteOptions pathProperties(FetchPath pathProperties)
Construct JsonWriteOptions with the given pathProperties.
-
setPathProperties
public void setPathProperties(FetchPath pathProperties)
Set the Map of properties to include by path.
-
getPathProperties
public FetchPath getPathProperties()
Return the properties to include by path.
-
getInclude
public JsonConfig.Include getInclude()
Return the include mode for this request.
-
setInclude
public void setInclude(JsonConfig.Include include)
Set the include mode for this request.
-
setRootPathVisitor
public JsonWriteOptions setRootPathVisitor(JsonWriteBeanVisitor<?> visitor)
Register a JsonWriteBeanVisitor for the root level.
-
setPathVisitor
public JsonWriteOptions setPathVisitor(String path, JsonWriteBeanVisitor<?> visitor)
Register a JsonWriteBeanVisitor for the given path.
-
getVisitorMap
public Map<String,JsonWriteBeanVisitor<?>> getVisitorMap()
Return the Map of registered JsonWriteBeanVisitor's by path.
-
getObjectMapper
public Object getObjectMapper()
Return the jackson object mapper to use. If null the ObjectMapper from DatabaseConfig will be used.
-
setObjectMapper
public void setObjectMapper(Object objectMapper)
Set the jackson object mapper to use. If null the ObjectMapper from DatabaseConfig will be used.
-
-