Package org.apache.axiom.om
Class OMOutputFormat
java.lang.Object
org.apache.axiom.om.OMOutputFormat
Formats options for OM Output.
Setting of all the properties in a OMOutputFormat should be done before calling the getContentType() method. It is advised to set all the properties at the creation time of the OMOutputFormat and not to change them later.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
Field DEFAULT_CHAR_SET_ENCODING.static final String
Deprecated.As of version 1.2.13, Axiom always respects the order of attachments.static final Boolean
Deprecated.As of version 1.2.13, Axiom always respects the order of attachments.static final String
Deprecated. -
Constructor Summary
ConstructorsConstructorDescriptionOMOutputFormat
(OMOutputFormat format) Constructs a new instance by copying the configuration from an existing instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Returns the character set encoding scheme.Return the content-type value that should be written with the message.getContentTypeForMTOM
(String SOAPContentType) Generates a Content-Type value for MTOM messages.getContentTypeForSwA
(String SOAPContentType) int
getProperty
(String key) Deprecated.boolean
Deprecated.boolean
Indicates whether the document should be serialized using SwA.boolean
boolean
Indicates whether the document should be serialized using MTOM.boolean
isSOAP11()
void
setAutoCloseWriter
(boolean autoCloseWriter) Deprecated.void
setCharSetEncoding
(String charSetEncoding) void
setContentTransferEncodingPolicy
(ContentTransferEncodingPolicy contentTransferEncodingPolicy) void
Set a raw content-type (i.e.void
setContentTypeProvider
(ContentTypeProvider contentTypeProvider) void
setDoingSWA
(boolean doingSWA) Specifies that the document should be serialized using SwA (SOAP with Attachments).void
setDoOptimize
(boolean optimize) Specifies that the document should be serialized using MTOM.void
setIgnoreXMLDeclaration
(boolean ignoreXMLDeclaration) void
setMimeBoundary
(String mimeBoundary) void
setOptimizedThreshold
(int optimizedThreshold) setProperty
(String key, Object value) void
setRootContentId
(String rootContentId) void
setSOAP11
(boolean b) void
setStAXWriterConfiguration
(StAXWriterConfiguration writerConfiguration) Deprecated.void
setXmlVersion
(String xmlVersion) toString()
Use toString for logging state of the OMOutputFormat
-
Field Details
-
DEFAULT_CHAR_SET_ENCODING
Field DEFAULT_CHAR_SET_ENCODING. Specifies the default character encoding scheme to be used.- See Also:
-
ACTION_PROPERTY
- See Also:
-
USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS
Deprecated.- See Also:
-
RESPECT_SWA_ATTACHMENT_ORDER
Deprecated.As of version 1.2.13, Axiom always respects the order of attachments.- See Also:
-
RESPECT_SWA_ATTACHMENT_ORDER_DEFAULT
Deprecated.As of version 1.2.13, Axiom always respects the order of attachments.
-
-
Constructor Details
-
OMOutputFormat
public OMOutputFormat() -
OMOutputFormat
Constructs a new instance by copying the configuration from an existing instance. Note that this will only copy configuration data, but not information that is subject to auto-generation, such as the root content ID or the MIME boundary.- Parameters:
format
- the existing instance
-
-
Method Details
-
getProperty
- Parameters:
key
- String- Returns:
- property or null
-
setProperty
- Parameters:
key
- Stringvalue
- Object- Returns:
- old value or null
-
containsKey
- Parameters:
key
-- Returns:
- true if known key
-
isOptimized
public boolean isOptimized()Indicates whether the document should be serialized using MTOM.- Returns:
true
if the document should be serialized using MTOM;false
otherwise; the return value is alwaysfalse
ifisDoingSWA()
returnstrue
-
getContentType
Return the content-type value that should be written with the message. (i.e. if optimized, then a multipart/related content-type is returned).- Returns:
- content-type value
-
setContentType
Set a raw content-type (i.e. "text/xml" (SOAP 1.1) or "application/xml" (REST)) If this method is not invoked, OMOutputFormat will choose a content-type value consistent with the soap version.- Parameters:
c
-
-
getMimeBoundary
-
getRootContentId
-
getNextContentId
-
getCharSetEncoding
Returns the character set encoding scheme.- Returns:
- Returns encoding string or null if it has not been set.
-
setCharSetEncoding
-
getXmlVersion
-
setXmlVersion
-
setSOAP11
public void setSOAP11(boolean b) -
isSOAP11
public boolean isSOAP11() -
isIgnoreXMLDeclaration
public boolean isIgnoreXMLDeclaration() -
setIgnoreXMLDeclaration
public void setIgnoreXMLDeclaration(boolean ignoreXMLDeclaration) -
setDoOptimize
public void setDoOptimize(boolean optimize) Specifies that the document should be serialized using MTOM. Note that this setting is ignored if SwA is enabled usingsetDoingSWA(boolean)
.- Parameters:
optimize
-true
if the document should be serialized using MTOM;false
otherwise
-
isDoingSWA
public boolean isDoingSWA()Indicates whether the document should be serialized using SwA.- Returns:
true
if the document should be serialized using SwA;false
otherwise
-
setDoingSWA
public void setDoingSWA(boolean doingSWA) Specifies that the document should be serialized using SwA (SOAP with Attachments). When SwA is enabled, then any configuration done usingsetDoOptimize(boolean)
is ignored.- Parameters:
doingSWA
-true
if the document should be serialized using SwA;false
otherwise
-
getContentTypeForMTOM
Generates a Content-Type value for MTOM messages. This is a MIME Multipart/Related Content-Type value as defined by RFC 2387 and the XOP specification. The generated header will look like the following: Content-Type: multipart/related; boundary="[MIME BOUNDARY VALUE]"; type="application/xop+xml"; start="[MESSAGE CONTENT ID]"; start-info="[MESSAGE CONTENT TYPE]";- Parameters:
SOAPContentType
-- Returns:
- TODO
-
getContentTypeForSwA
-
isAutoCloseWriter
public boolean isAutoCloseWriter()Deprecated. -
setAutoCloseWriter
public void setAutoCloseWriter(boolean autoCloseWriter) Deprecated. -
setMimeBoundary
-
setRootContentId
-
toString
Use toString for logging state of the OMOutputFormat -
setOptimizedThreshold
public void setOptimizedThreshold(int optimizedThreshold) -
getOptimizedThreshold
public int getOptimizedThreshold() -
getStAXWriterConfiguration
Deprecated.Get the currently configured StAX writer configuration.- Returns:
- the current configuration;
StAXWriterConfiguration.DEFAULT
if none has been set explicitly
-
setStAXWriterConfiguration
Deprecated.Set the StAX writer configuration that will be used when requesting anXMLStreamWriter
fromStAXUtils
.- Parameters:
writerConfiguration
- the configuration
-
getContentTypeProvider
-
setContentTypeProvider
-
getContentTransferEncodingPolicy
-
setContentTransferEncodingPolicy
public void setContentTransferEncodingPolicy(ContentTransferEncodingPolicy contentTransferEncodingPolicy)
-