Class HttpBodyMap

java.lang.Object
org.refcodes.struct.PathMapBuilderImpl<String>
org.refcodes.struct.CanonicalMapBuilderImpl
org.refcodes.web.HttpBodyMap
All Implemented Interfaces:
Serializable, Map<String,String>, org.refcodes.mixin.AnnotatorAccessor, org.refcodes.mixin.Clearable, org.refcodes.mixin.DelimiterAccessor, org.refcodes.mixin.Dumpable, org.refcodes.mixin.EmptyAccessor, org.refcodes.mixin.TypeAccessor<String>, org.refcodes.struct.CanonicalMap, org.refcodes.struct.CanonicalMap.CanonicalMapBuilder, org.refcodes.struct.CanonicalMap.MutableCanonicalMap, org.refcodes.struct.Containable, org.refcodes.struct.InterOperableMap<String>, org.refcodes.struct.InterOperableMap.InterOperableMapBuilder<String>, org.refcodes.struct.InterOperableMap.MutableInterOperableMap<String>, org.refcodes.struct.Keys<String,String>, org.refcodes.struct.Keys.MutableKeys<String,String>, org.refcodes.struct.Keys.MutableValues<String,String>, org.refcodes.struct.PathMap<String>, org.refcodes.struct.PathMap.MutablePathMap<String>, org.refcodes.struct.PathMap.PathMapBuilder<String>, org.refcodes.struct.Table<String,String>, org.refcodes.struct.Table.TableDictionary<String,String>, org.refcodes.struct.Table.TableDictionary.TableBuilder<String,String,org.refcodes.struct.PathMap.PathMapBuilder<String>>

public class HttpBodyMap extends org.refcodes.struct.CanonicalMapBuilderImpl
The HttpBodyMap type is a "dynamic" type in terms of it's structure being represented by paths'. When a data structure is parsed e.g. from JSON or XML, then the data structure's internal structure and values are reflected by according paths's and values in the HttpBodyMap. The HttpBodyMap is actually a https://www.metacodes.proization of the PathMap using String objects as values and a slash ("/") as path delimiter. Using the HttpBodyMap it is convenient to navigate or address elements from unknown or dynamic data structures. The other way round the HttpBodyMap may be used to construct dynamic data types by adding the according paths's and values for marshaling into e.g. JSON or XML. Think of an HttpBodyMap as a flattened JSON or XML structure. The HttpClientResponse, HttpServerRequest, HttpServerResponse as well as the HttpClientResponse implementations directly support the HttpBodyMap, given that the MediaTypeFactory being used supports marshaling and unmarshaling from and to nested Map instances. The HttpBodyMap acts as a view of the nested Map structures, which are somehow inconvenient to navigate through. The HttpClientRequest.setRequest(Object) implementation supports the HttpBodyMap to marshal an HttpBodyMap into an HTTP Request-Body. The HttpClientResponse.getResponse(Class) implementation supports the HttpBodyMap to unmarshal an HTTP Response-Body into an HttpBodyMap. The HttpServerRequest.getRequest(Class) implementation supports the HttpBodyMap to unmarshal an HTTP Request-Body into an HttpBodyMap. The HttpServerResponse.setResponse(Object) implementation supports the HttpBodyMap to marshal an HttpBodyMap into an HTTP Request-Body.
See Also:
  • Field Details

  • Constructor Details

    • HttpBodyMap

      public HttpBodyMap()
      Create an empty HttpBodyMap instance using the public path delimiter "/" (Delimiter.PATH) for the path declarations.
    • HttpBodyMap

      public HttpBodyMap(Object aObj)
      Create a HttpBodyMap instance containing the elements as of PathMap.MutablePathMap.insert(Object) using the public path delimiter "/" (Delimiter.PATH) for the path declarations.
      Parameters:
      aObj - The object from which the elements are to be added.
    • HttpBodyMap

      public HttpBodyMap(String aToPath, Object aObj)
      Create a HttpBodyMap instance containing the elements as of PathMap.MutablePathMap.insert(Object) using the public path delimiter "/" (Delimiter.PATH) for the path declarations.
      Parameters:
      aToPath - The sub-path where to insert the object's introspected values to.
      aObj - The object from which the elements are to be added.
    • HttpBodyMap

      public HttpBodyMap(Object aObj, String aFromPath)
      Creates a HttpBodyMap instance containing the elements as of PathMap.MutablePathMap.insert(Object) using the public path delimiter "/" (Delimiter.PATH) for the path declarations.
      Parameters:
      aObj - The object from which the elements are to be added.
      aFromPath - The path from where to start adding elements of the provided object.
    • HttpBodyMap

      public HttpBodyMap(String aToPath, Object aObj, String aFromPath)
      Creates a HttpBodyMap instance containing the elements as of PathMap.MutablePathMap.insert(Object) using the public path delimiter "/" (Delimiter.PATH for the path declarations.
      Parameters:
      aToPath - The sub-path where to insert the object's introspected values to.
      aObj - The object from which the elements are to be added.
      aFromPath - The path from where to start adding elements of the provided object.
  • Method Details