Class AnnotatedXmlMessageWriter

java.lang.Object
com.emc.documentum.rest.wire.RestBindingConfigAware
com.emc.documentum.rest.wire.xml.AnnotatedXmlMessageWriter
All Implemented Interfaces:
StreamingMessageWriter

public class AnnotatedXmlMessageWriter extends RestBindingConfigAware implements StreamingMessageWriter
An implementation of StreamingMessageWriter which writes the XML message from the annotated model instance.
  • Constructor Details

    • AnnotatedXmlMessageWriter

      public AnnotatedXmlMessageWriter()
      Default constructor.
    • AnnotatedXmlMessageWriter

      public AnnotatedXmlMessageWriter(com.emc.documentum.rest.config.BindingConfig bindingConfig)
      Constructor with a custom binding configuration.
      Parameters:
      bindingConfig - the binding configuration.
  • Method Details

    • setNamespaceBinding

      @Deprecated public void setNamespaceBinding(Map<String,String> namespaceBinding)
      Deprecated.
      Since from 7.3, please use BindingConfig to configure this parameter.
      Sets the XML namespace binding.
      Parameters:
      namespaceBinding - the mapping for name spaces where the key is the namespace prefix and the value is the namespace URL. When the key is empty, the namespace is taken as the default namespace.
    • setSuggestedNamespace

      @Deprecated public void setSuggestedNamespace(String suggestedNamespace)
      Deprecated.
      Since 7.3, the writer will intelligently add the namespace. Do not use this method any more.
      Sets the suggested XML namespace. This setting is deprecated since the writer can automatically determine the default namespace by examining the XMl namespace on the root object.
      Parameters:
      suggestedNamespace - the suggested name namespace is taken as the default namespace.
    • setShowNamespaceBindingInRoot

      @Deprecated public void setShowNamespaceBindingInRoot(boolean writeUnsedNamespaceInRoot)
      Deprecated.
      Since from 7.3, please use BindingConfig to configure this parameter.
      Specifies whether to write unused namespaces in the XML root element..
      Parameters:
      writeUnsedNamespaceInRoot - t true if to write all namespaces in the XML root element; false otherwise.
    • write

      public void write(Object t, OutputStream outputStream) throws IOException
      Write the model to message output stream.
      Specified by:
      write in interface StreamingMessageWriter
      Parameters:
      t - the model instance
      outputStream - the message output stream
      Throws:
      IOException - when there are errors in writing the object
    • write

      public void write(Object t, OutputStream outputStream, org.springframework.http.MediaType contentType) throws IOException
      Write the model to message output stream with specified media type
      Specified by:
      write in interface StreamingMessageWriter
      Parameters:
      t - the model instance
      outputStream - the message output stream
      contentType - the content type of the output message
      Throws:
      IOException - when there are errors in writing the object