org.apache.axiom.om
Class OMOutputFormat

java.lang.Object
  extended by org.apache.axiom.om.OMOutputFormat

public class OMOutputFormat
extends java.lang.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
static java.lang.String ACTION_PROPERTY
           
private  boolean autoCloseWriter
           
private  java.lang.String charSetEncoding
           
private  java.lang.String contentType
           
static java.lang.String DEFAULT_CHAR_SET_ENCODING
          Field DEFAULT_CHAR_SET_ENCODING.
private  boolean doingSWA
           
private  boolean doOptimize
           
private  boolean ignoreXMLDeclaration
           
private  boolean isSoap11
           
private static org.apache.commons.logging.Log log
           
(package private)  java.util.HashMap map
           
private  java.lang.String mimeBoundary
           
private  int nextid
           
private  int optimizedThreshold
           
private  java.lang.String rootContentId
           
private  java.lang.String xmlVersion
           
 
Constructor Summary
OMOutputFormat()
           
 
Method Summary
 boolean containsKey(java.lang.String key)
           
 java.lang.String getCharSetEncoding()
          Returns the character set encoding scheme.
 java.lang.String getContentType()
          Return the content-type value that should be written with the message.
 java.lang.String getContentTypeForMTOM(java.lang.String SOAPContentType)
          Generates a Content-Type value for MTOM messages.
 java.lang.String getContentTypeForSwA(java.lang.String SOAPContentType)
           
 java.lang.String getMimeBoundary()
           
 java.lang.String getNextContentId()
           
 int getOptimizedThreshold()
           
 java.lang.Object getProperty(java.lang.String key)
           
 java.lang.String getRootContentId()
           
 java.lang.String getXmlVersion()
           
 boolean isAutoCloseWriter()
           
 boolean isDoingSWA()
           
 boolean isIgnoreXMLDeclaration()
           
 boolean isOptimized()
           
 boolean isSOAP11()
           
 void setAutoCloseWriter(boolean autoCloseWriter)
           
 void setCharSetEncoding(java.lang.String charSetEncoding)
           
 void setContentType(java.lang.String c)
          Set a raw content-type (i.e.
 void setDoingSWA(boolean doingSWA)
           
 void setDoOptimize(boolean b)
           
 void setIgnoreXMLDeclaration(boolean ignoreXMLDeclaration)
           
 void setMimeBoundary(java.lang.String mimeBoundary)
           
 void setOptimizedThreshold(int optimizedThreshold)
           
 java.lang.Object setProperty(java.lang.String key, java.lang.Object value)
           
 void setRootContentId(java.lang.String rootContentId)
           
 void setSOAP11(boolean b)
           
 void setXmlVersion(java.lang.String xmlVersion)
           
 java.lang.String toString()
          Use toString for logging state of the OMOutputFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

mimeBoundary

private java.lang.String mimeBoundary

rootContentId

private java.lang.String rootContentId

nextid

private int nextid

doOptimize

private boolean doOptimize

doingSWA

private boolean doingSWA

isSoap11

private boolean isSoap11

optimizedThreshold

private int optimizedThreshold

DEFAULT_CHAR_SET_ENCODING

public static final java.lang.String DEFAULT_CHAR_SET_ENCODING
Field DEFAULT_CHAR_SET_ENCODING. Specifies the default character encoding scheme to be used.

See Also:
Constant Field Values

charSetEncoding

private java.lang.String charSetEncoding

xmlVersion

private java.lang.String xmlVersion

contentType

private java.lang.String contentType

ignoreXMLDeclaration

private boolean ignoreXMLDeclaration

autoCloseWriter

private boolean autoCloseWriter

ACTION_PROPERTY

public static final java.lang.String ACTION_PROPERTY
See Also:
Constant Field Values

map

java.util.HashMap map
Constructor Detail

OMOutputFormat

public OMOutputFormat()
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String key)
Parameters:
key - String
Returns:
property or null

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.Object value)
Parameters:
key - String
value - Object
Returns:
old value or null

containsKey

public boolean containsKey(java.lang.String key)
Parameters:
key -
Returns:
true if known key

isOptimized

public boolean isOptimized()

getContentType

public java.lang.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(java.lang.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 java.lang.String getMimeBoundary()

getRootContentId

public java.lang.String getRootContentId()

getNextContentId

public java.lang.String getNextContentId()

getCharSetEncoding

public java.lang.String getCharSetEncoding()
Returns the character set encoding scheme. If the value of the charSetEncoding is not set then the default will be returned.

Returns:
Returns encoding string.

setCharSetEncoding

public void setCharSetEncoding(java.lang.String charSetEncoding)

getXmlVersion

public java.lang.String getXmlVersion()

setXmlVersion

public void setXmlVersion(java.lang.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 b)

isDoingSWA

public boolean isDoingSWA()

setDoingSWA

public void setDoingSWA(boolean doingSWA)

getContentTypeForMTOM

public java.lang.String getContentTypeForMTOM(java.lang.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:

getContentTypeForSwA

public java.lang.String getContentTypeForSwA(java.lang.String SOAPContentType)

isAutoCloseWriter

public boolean isAutoCloseWriter()

setAutoCloseWriter

public void setAutoCloseWriter(boolean autoCloseWriter)

setMimeBoundary

public void setMimeBoundary(java.lang.String mimeBoundary)

setRootContentId

public void setRootContentId(java.lang.String rootContentId)

toString

public java.lang.String toString()
Use toString for logging state of the OMOutputFormat

Overrides:
toString in class java.lang.Object

setOptimizedThreshold

public void setOptimizedThreshold(int optimizedThreshold)

getOptimizedThreshold

public int getOptimizedThreshold()