Module io.ebean.api

Class 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 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.
      • 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.