Package org.apache.axiom.om
Class OMOutputFormat
- java.lang.Object
-
- org.apache.axiom.om.OMOutputFormat
-
public class OMOutputFormat extends Object
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
Fields Modifier and Type Field Description static StringACTION_PROPERTYstatic StringDEFAULT_CHAR_SET_ENCODINGField DEFAULT_CHAR_SET_ENCODING.static StringRESPECT_SWA_ATTACHMENT_ORDERstatic BooleanRESPECT_SWA_ATTACHMENT_ORDER_DEFAULTstatic StringUSE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS
-
Constructor Summary
Constructors Constructor Description OMOutputFormat()OMOutputFormat(OMOutputFormat format)Constructs a new instance by copying the configuration from an existing instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancontainsKey(String key)StringgetCharSetEncoding()Returns the character set encoding scheme.StringgetContentType()Return the content-type value that should be written with the message.StringgetContentTypeForMTOM(String SOAPContentType)Generates a Content-Type value for MTOM messages.StringgetContentTypeForSwA(String SOAPContentType)StringgetMimeBoundary()MultipartWriterFactorygetMultipartWriterFactory()Get the currently configured multipart writer factory.StringgetNextContentId()intgetOptimizedThreshold()ObjectgetProperty(String key)StringgetRootContentId()StAXWriterConfigurationgetStAXWriterConfiguration()Get the currently configured StAX writer configuration.XMLStreamWriterFiltergetXmlStreamWriterFilter()StringgetXmlVersion()booleanisAutoCloseWriter()Deprecated.booleanisDoingSWA()Indicates whether the document should be serialized using SwA.booleanisIgnoreXMLDeclaration()booleanisOptimized()Indicates whether the document should be serialized using MTOM.booleanisSOAP11()voidsetAutoCloseWriter(boolean autoCloseWriter)Deprecated.voidsetCharSetEncoding(String charSetEncoding)voidsetContentType(String c)Set a raw content-type (i.e.voidsetDoingSWA(boolean doingSWA)Specifies that the document should be serialized using SwA (SOAP with Attachments).voidsetDoOptimize(boolean optimize)Specifies that the document should be serialized using MTOM.voidsetIgnoreXMLDeclaration(boolean ignoreXMLDeclaration)voidsetMimeBoundary(String mimeBoundary)voidsetMultipartWriterFactory(MultipartWriterFactory multipartWriterFactory)Set the multipart writer factory.voidsetOptimizedThreshold(int optimizedThreshold)ObjectsetProperty(String key, Object value)voidsetRootContentId(String rootContentId)voidsetSOAP11(boolean b)voidsetStAXWriterConfiguration(StAXWriterConfiguration writerConfiguration)Set the StAX writer configuration that will be used when requesting anXMLStreamWriterfromStAXUtils.voidsetXmlStreamWriterFilter(XMLStreamWriterFilter xmlStreamWriterFilter)voidsetXmlVersion(String xmlVersion)StringtoString()Use toString for logging state of the OMOutputFormat
-
-
-
Field Detail
-
DEFAULT_CHAR_SET_ENCODING
public static final String DEFAULT_CHAR_SET_ENCODING
Field DEFAULT_CHAR_SET_ENCODING. Specifies the default character encoding scheme to be used.- See Also:
- Constant Field Values
-
ACTION_PROPERTY
public static final String ACTION_PROPERTY
- See Also:
- Constant Field Values
-
USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS
public static final String USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS
- See Also:
- Constant Field Values
-
RESPECT_SWA_ATTACHMENT_ORDER
public static final String RESPECT_SWA_ATTACHMENT_ORDER
- See Also:
- Constant Field Values
-
RESPECT_SWA_ATTACHMENT_ORDER_DEFAULT
public static final Boolean RESPECT_SWA_ATTACHMENT_ORDER_DEFAULT
-
-
Constructor Detail
-
OMOutputFormat
public OMOutputFormat()
-
OMOutputFormat
public OMOutputFormat(OMOutputFormat format)
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 Detail
-
getProperty
public Object getProperty(String key)
- Parameters:
key- String- Returns:
- property or null
-
setProperty
public Object setProperty(String key, Object value)
- Parameters:
key- Stringvalue- Object- Returns:
- old value or null
-
containsKey
public boolean containsKey(String key)
- Parameters:
key-- Returns:
- true if known key
-
isOptimized
public boolean isOptimized()
Indicates whether the document should be serialized using MTOM.- Returns:
trueif the document should be serialized using MTOM;falseotherwise; the return value is alwaysfalseifisDoingSWA()returnstrue
-
getContentType
public String 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
public void setContentType(String c)
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
public String getMimeBoundary()
-
getRootContentId
public String getRootContentId()
-
getNextContentId
public String getNextContentId()
-
getCharSetEncoding
public String getCharSetEncoding()
Returns the character set encoding scheme.- Returns:
- Returns encoding string or null if it has not been set.
-
setCharSetEncoding
public void setCharSetEncoding(String charSetEncoding)
-
getXmlVersion
public String getXmlVersion()
-
setXmlVersion
public void setXmlVersion(String xmlVersion)
-
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-trueif the document should be serialized using MTOM;falseotherwise
-
isDoingSWA
public boolean isDoingSWA()
Indicates whether the document should be serialized using SwA.- Returns:
trueif the document should be serialized using SwA;falseotherwise
-
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-trueif the document should be serialized using SwA;falseotherwise
-
getContentTypeForMTOM
public String getContentTypeForMTOM(String SOAPContentType)
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
-
isAutoCloseWriter
public boolean isAutoCloseWriter()
Deprecated.
-
setAutoCloseWriter
public void setAutoCloseWriter(boolean autoCloseWriter)
Deprecated.
-
setMimeBoundary
public void setMimeBoundary(String mimeBoundary)
-
setRootContentId
public void setRootContentId(String rootContentId)
-
toString
public String toString()
Use toString for logging state of the OMOutputFormat
-
setOptimizedThreshold
public void setOptimizedThreshold(int optimizedThreshold)
-
getOptimizedThreshold
public int getOptimizedThreshold()
-
getXmlStreamWriterFilter
public XMLStreamWriterFilter getXmlStreamWriterFilter()
- Returns:
- the xmlStreamWriterFilter
-
setXmlStreamWriterFilter
public void setXmlStreamWriterFilter(XMLStreamWriterFilter xmlStreamWriterFilter)
- Parameters:
xmlStreamWriterFilter- the xmlStreamWriterFilter to set
-
getStAXWriterConfiguration
public StAXWriterConfiguration getStAXWriterConfiguration()
Get the currently configured StAX writer configuration.- Returns:
- the current configuration;
StAXWriterConfiguration.DEFAULTif none has been set explicitly
-
setStAXWriterConfiguration
public void setStAXWriterConfiguration(StAXWriterConfiguration writerConfiguration)
Set the StAX writer configuration that will be used when requesting anXMLStreamWriterfromStAXUtils.- Parameters:
writerConfiguration- the configuration
-
getMultipartWriterFactory
public MultipartWriterFactory getMultipartWriterFactory()
Get the currently configured multipart writer factory.- Returns:
- the current factory; if none has been set explicitly, an
AxiomMultipartWriterFactoryinstance is returned
-
setMultipartWriterFactory
public void setMultipartWriterFactory(MultipartWriterFactory multipartWriterFactory)
Set the multipart writer factory. This factory is used to create MIME packages when MTOM or SwA is enabled.- Parameters:
multipartWriterFactory- the factory
-
-