Package com.emc.documentum.rest.wire.xml
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 Summary
ConstructorDescriptionDefault constructor.AnnotatedXmlMessageWriter
(com.emc.documentum.rest.config.BindingConfig bindingConfig) Constructor with a custom binding configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoid
setNamespaceBinding
(Map<String, String> namespaceBinding) Deprecated.void
setShowNamespaceBindingInRoot
(boolean writeUnsedNamespaceInRoot) Deprecated.Since from 7.3, please useBindingConfig
to configure this parameter.void
setSuggestedNamespace
(String suggestedNamespace) Deprecated.Since 7.3, the writer will intelligently add the namespace.void
write
(Object t, OutputStream outputStream) Write the model to message output stream.void
write
(Object t, OutputStream outputStream, org.springframework.http.MediaType contentType) Write the model to message output stream with specified media typeMethods inherited from class com.emc.documentum.rest.wire.RestBindingConfigAware
getBindingConfig
-
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.Since from 7.3, please useBindingConfig
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.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.Since from 7.3, please useBindingConfig
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
Write the model to message output stream.- Specified by:
write
in interfaceStreamingMessageWriter
- Parameters:
t
- the model instanceoutputStream
- 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 interfaceStreamingMessageWriter
- Parameters:
t
- the model instanceoutputStream
- the message output streamcontentType
- the content type of the output message- Throws:
IOException
- when there are errors in writing the object
-
BindingConfig
to configure this parameter.