AbstractWrappedMessage (Apache CXF JavaDoc 3.6.11 API)

Package org.apache.cxf.message

## Class AbstractWrappedMessage

- java.lang.Object
- - org.apache.cxf.message.AbstractWrappedMessage

- All Implemented Interfaces:
    `Map<String,​Object>`, `Message`, `StringMap`
  Direct Known Subclasses:
    `XMLMessage`

      public abstract class AbstractWrappedMessage
      extends Object
      implements Message

  A base class to build your own message implementations on.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface java.util.Map

      `Map.Entry<K extends Object,​V extends Object>`

  - ### Field Summary

    - ### Fields inherited from interface org.apache.cxf.message.Message

      `ACCEPT_CONTENT_TYPE, ASYNC_POST_RESPONSE_DISPATCH, ATTACHMENTS, BASE_PATH, CONNECTION_TIMEOUT, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, DECOUPLED_CHANNEL_MESSAGE, EMPTY_PARTIAL_RESPONSE_MESSAGE, ENCODING, ENDPOINT_ADDRESS, ERROR_MESSAGE, EXCEPTION_CAUSE_SUFFIX, EXCEPTION_MESSAGE_CAUSE_ENABLED, FAULT_IN_INTERCEPTORS, FAULT_OUT_INTERCEPTORS, FAULT_STACKTRACE_ENABLED, FIXED_PARAMETER_ORDER, HTTP_REQUEST_METHOD, IN_INTERCEPTORS, INBOUND_MESSAGE, INTERCEPTOR_PROVIDERS, INVOCATION_CONTEXT, MAINTAIN_SESSION, MIME_HEADERS, MTOM_ENABLED, MTOM_THRESHOLD, ONE_WAY_REQUEST, OUT_INTERCEPTORS, PARTIAL_ATTACHMENTS_MESSAGE, PARTIAL_RESPONSE_MESSAGE, PATH_INFO, PROCESS_202_RESPONSE_ONEWAY_OR_PARTIAL, PROCESS_ONEWAY_RESPONSE, PROPAGATE_202_RESPONSE_ONEWAY_OR_PARTIAL, PROPOGATE_EXCEPTION, PROTOCOL_HEADERS, QUERY_STRING, RECEIVE_TIMEOUT, REQUEST_URI, REQUEST_URL, REQUESTOR_ROLE, RESPONSE_CODE, REST_MESSAGE, ROBUST_ONEWAY, SCHEMA_VALIDATION_ENABLED, SCHEMA_VALIDATION_TYPE, SERVICE_OBJECT, THREAD_CONTEXT_SWITCHED, THREAD_SAFE_STAX_FACTORIES, TRANSPORT, WSDL_DESCRIPTION, WSDL_INTERFACE, WSDL_OPERATION, WSDL_PORT, WSDL_SERVICE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `AbstractWrappedMessage​(Message msg)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clear()` |
    `boolean` | `containsKey​(Object key)` |
    `boolean` | `containsValue​(Object value)` |
    `Set<Map.Entry<String,​Object>>` | `entrySet()` |
    `boolean` | `equals​(Object o)` |
    `<T> T` | `get​(Class<T> key)` | Convenience method for storing/retrieving typed objects from the map.
    `Object` | `get​(Object key)` |
    `Collection<Attachment>` | `getAttachments()` | Retrieve any binary attachments associated with the message.
    `<T> T` | `getContent​(Class<T> format)` | Retrieve the encapsulated content as a particular type.
    `Set<Class<?>>` | `getContentFormats()` |
    `Object` | `getContextualProperty​(String key)` | Queries the Message object's metadata for a specific property.
    `Set<String>` | `getContextualPropertyKeys()` |
    `Destination` | `getDestination()` |
    `Exchange` | `getExchange()` |
    `String` | `getId()` |
    `InterceptorChain` | `getInterceptorChain()` | Returns a live copy of the messages interceptor chain.
    `Message` | `getMessage()` |
    `int` | `hashCode()` |
    `boolean` | `isEmpty()` |
    `Set<String>` | `keySet()` |
    `<T> void` | `put​(Class<T> key, T value)` | Convenience method for storing/retrieving typed objects from the map.
    `Object` | `put​(String key, Object value)` |
    `void` | `putAll​(Map<? extends String,​? extends Object> t)` |
    `<T> T` | `remove​(Class<T> key)` | Convenience method for removing typed objects from the map.
    `Object` | `remove​(Object key)` |
    `<T> void` | `removeContent​(Class<T> format)` | Removes a content from a message.
    `void` | `resetContextCache()` | Resets the cache of contextual properties that messages may contain.
    `void` | `setAttachments​(Collection<Attachment> attachments)` |
    `<T> void` | `setContent​(Class<T> format, Object content)` | Provide the encapsulated content as a particular type (a result type if message is outbound, a source type if message is inbound)
    `void` | `setExchange​(Exchange exchange)` |
    `void` | `setId​(String id)` |
    `void` | `setInterceptorChain​(InterceptorChain chain)` |
    `void` | `setMessage​(Message message)` |
    `int` | `size()` |
    `Collection<Object>` | `values()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map

      `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- - ### Constructor Detail

    - #### AbstractWrappedMessage

          protected AbstractWrappedMessage​(Message msg)

  - ### Method Detail

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Map<String,​Object>`

    - #### containsKey

          public boolean containsKey​(Object key)

      Specified by:
        `containsKey` in interface `Map<String,​Object>`

    - #### containsValue

          public boolean containsValue​(Object value)

      Specified by:
        `containsValue` in interface `Map<String,​Object>`

    - #### entrySet

          public Set<Map.Entry<String,​Object>> entrySet()

      Specified by:
        `entrySet` in interface `Map<String,​Object>`

    - #### equals

          public boolean equals​(Object o)

      Specified by:
        `equals` in interface `Map<String,​Object>`
      Overrides:
        `equals` in class `Object`

    - #### get

          public Object get​(Object key)

      Specified by:
        `get` in interface `Map<String,​Object>`

    - #### getAttachments

          public Collection<Attachment> getAttachments()

      Description copied from interface: `Message`
      Retrieve any binary attachments associated with the message.
      Specified by:
        `getAttachments` in interface `Message`
      Returns:
        a collection containing the attachments

    - #### setAttachments

          public void setAttachments​(Collection<Attachment> attachments)

      Specified by:
        `setAttachments` in interface `Message`

    - #### getMessage

          public Message getMessage()

    - #### setMessage

          public void setMessage​(Message message)

    - #### getDestination

          public Destination getDestination()

      Specified by:
        `getDestination` in interface `Message`
      Returns:
        the associated Destination if message is inbound, null otherwise

    - #### getExchange

          public Exchange getExchange()

      Specified by:
        `getExchange` in interface `Message`

    - #### setExchange

          public final void setExchange​(Exchange exchange)

      Specified by:
        `setExchange` in interface `Message`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `Message`

    - #### setId

          public void setId​(String id)

      Specified by:
        `setId` in interface `Message`

    - #### getInterceptorChain

          public InterceptorChain getInterceptorChain()

      Description copied from interface: `Message`
      Returns a live copy of the messages interceptor chain. This is useful when an interceptor wants to modify the interceptor chain on the fly.
      Specified by:
        `getInterceptorChain` in interface `Message`
      Returns:
        the interceptor chain used to process the message

    - #### setInterceptorChain

          public void setInterceptorChain​(InterceptorChain chain)

      Specified by:
        `setInterceptorChain` in interface `Message`

    - #### getContent

          public <T> T getContent​(Class<T> format)

      Description copied from interface: `Message`
      Retrieve the encapsulated content as a particular type. The content is available as a result type if the message is outbound. The content is available as a source type if message is inbound. If the content is not available as the specified type null is returned.
      Specified by:
        `getContent` in interface `Message`
      Parameters:
        `format` - the expected content format
      Returns:
        the encapsulated content

    - #### removeContent

          public <T> void removeContent​(Class<T> format)

      Description copied from interface: `Message`
      Removes a content from a message. If some contents are completely consumed, removing them is a good idea
      Specified by:
        `removeContent` in interface `Message`
      Parameters:
        `format` - the format to remove

    - #### getContentFormats

          public Set<Class<?>> getContentFormats()

      Specified by:
        `getContentFormats` in interface `Message`
      Returns:
        the set of currently encapsulated content formats

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Map<String,​Object>`
      Overrides:
        `hashCode` in class `Object`

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `Map<String,​Object>`

    - #### keySet

          public Set<String> keySet()

      Specified by:
        `keySet` in interface `Map<String,​Object>`

    - #### put

          public Object put​(String key,
                            Object value)

      Specified by:
        `put` in interface `Map<String,​Object>`

    - #### putAll

          public void putAll​(Map<? extends String,​? extends Object> t)

      Specified by:
        `putAll` in interface `Map<String,​Object>`

    - #### remove

          public Object remove​(Object key)

      Specified by:
        `remove` in interface `Map<String,​Object>`

    - #### setContent

          public <T> void setContent​(Class<T> format,
                                     Object content)

      Description copied from interface: `Message`
      Provide the encapsulated content as a particular type (a result type if message is outbound, a source type if message is inbound)
      Specified by:
        `setContent` in interface `Message`
      Parameters:
        `format` - the provided content format
        `content` - the content to be encapsulated

    - #### size

          public int size()

      Specified by:
        `size` in interface `Map<String,​Object>`

    - #### values

          public Collection<Object> values()

      Specified by:
        `values` in interface `Map<String,​Object>`

    - #### get

          public <T> T get​(Class<T> key)

      Description copied from interface: `StringMap`
      Convenience method for storing/retrieving typed objects from the map. equivalent to: (T)get(key.getName());
      Specified by:
        `get` in interface `StringMap`
      Parameters:
        `key` - the key
      Returns:
        the value

    - #### put

          public <T> void put​(Class<T> key,
                              T value)

      Description copied from interface: `StringMap`
      Convenience method for storing/retrieving typed objects from the map. equivalent to: put(key.getName(), value);
      Specified by:
        `put` in interface `StringMap`
      Parameters:
        `key` - the key
        `value` - the value

    - #### remove

          public <T> T remove​(Class<T> key)

      Description copied from interface: `StringMap`
      Convenience method for removing typed objects from the map. equivalent to: (T)remove(key.getName());
      Specified by:
        `remove` in interface `StringMap`
      Parameters:
        `key` - the key

    - #### getContextualProperty

          public Object getContextualProperty​(String key)

      Description copied from interface: `Message`
      Queries the Message object's metadata for a specific property.
      Specified by:
        `getContextualProperty` in interface `Message`
      Parameters:
        `key` - the Message interface's property strings that correlates to the desired property
      Returns:
        the property's value

    - #### getContextualPropertyKeys

          public Set<String> getContextualPropertyKeys()

      Specified by:
        `getContextualPropertyKeys` in interface `Message`
      Returns:
        set of defined contextual property keys

    - #### resetContextCache

          public void resetContextCache()

      Description copied from interface: `Message`
      Resets the cache of contextual properties that messages may contain. Subsequent calls to getContextualProperty will likely recalculate the cache.
      Specified by:
        `resetContextCache` in interface `Message`