org.jibx.ws.io
Class MessageOptions

java.lang.Object
  extended by org.jibx.ws.io.MessageOptions

public final class MessageOptions
extends Object

Defines options for the encoding, XML declaration and formatting of the XML message, and the media types for the message.


Constructor Summary
MessageOptions()
          Default constructor for UTF-8, with no formatting and XML declaration containing XML version only.
MessageOptions(char indentChar, int indentCount, String newLine)
          Construct with message formatting details.
MessageOptions(MessageOptions options)
          Copy constructor.
MessageOptions(XmlEncoding encoding)
          Construct with specified encoding, no formatting and XML declaration containing XML version only.
MessageOptions(XmlEncoding encoding, boolean includeEncodingDecl, Boolean standaloneDecl)
          Construct with specified encoding and XML declaration, with no formatting.
MessageOptions(XmlEncoding encoding, boolean includeEncodingDecl, Boolean standaloneDecl, char indentChar, int indentCount, String newLine)
          Construct with specified message encoding, formatting and XML declaration.
MessageOptions(XmlEncoding encoding, char indentChar, int indentCount, String newLine)
          Construct with specified message encoding and formatting, with default XML declaration containing XML version only.
 
Method Summary
 XmlEncoding getEncoding()
          Gets the encoding to use for the message.
 String getEncodingDeclString()
          Returns the value of the encoding attribute for the XML declaration.
 char getIndentChar()
          Get the character to use for indenting the XML.
 int getIndentCount()
          Get the number of indent characters to indent the XML by.
 String[] getInMediaTypeCodes()
          Get the media type short code(s) to be accepted for input.
 String getNewLine()
          Get the string to use for new lines.
 String getOutMediaTypeCode()
          Get the media type short code to be used for output.
 Boolean getStandaloneDecl()
          Get the setting for the standalone attribute of the XML declaration.
 String getStandaloneDeclString()
          Returns the value of the standalone attribute for the XML declaration.
 XmlOptions getXmlOptions()
          Returns the Xml options for the message.
 boolean isIncludeEncodingDecl()
          Get the setting for whether to include the encoding attribute in the XML declaration.
 void setEncoding(XmlEncoding encoding)
          Sets the encoding to use for the message.
 void setIncludeEncodingDecl(boolean includeEncodingDecl)
          Set whether to include the encoding attribute in the XML declaration.
 void setIndentChar(char indentChar)
          Set the character to use for indenting the XML.
 void setIndentCount(int indentCount)
          Set the number of indent characters to indent the XML by.
 void setInMediaTypeCodes(String[] codes)
          Set the media type short code(s) to be accepted for input.
 void setNewLine(String newLine)
          Set the string to use for new lines.
 void setOutMediaTypeCode(String code)
          Set the media type short code to be used for output.
 void setStandaloneDecl(Boolean standaloneDecl)
          Set the standalone attribute of the XML declaration.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageOptions

public MessageOptions()
Default constructor for UTF-8, with no formatting and XML declaration containing XML version only.


MessageOptions

public MessageOptions(MessageOptions options)
Copy constructor.

Parameters:
options - the options to copy

MessageOptions

public MessageOptions(XmlEncoding encoding)
Construct with specified encoding, no formatting and XML declaration containing XML version only.

Parameters:
encoding - the encoding to apply to the message

MessageOptions

public MessageOptions(XmlEncoding encoding,
                      boolean includeEncodingDecl,
                      Boolean standaloneDecl)
Construct with specified encoding and XML declaration, with no formatting.

Parameters:
encoding - the encoding to apply to the message
includeEncodingDecl - true to include the encoding in the XML declaration, false omits the encoding in the XML declaration.
standaloneDecl - true to include standalone="yes" in the XML declaration, false to include standalone="no" in the XML declaration, null to exclude the standalone attribute from the XML declaration,

MessageOptions

public MessageOptions(char indentChar,
                      int indentCount,
                      String newLine)
Construct with message formatting details.

Parameters:
indentChar - the whitespace character to use for indenting XML.
indentCount - how many indentChars to indent by, disable indentation if negative (zero means new line only)
newLine - sequence of characters used for a line ending (null means use the single character '\n')

MessageOptions

public MessageOptions(XmlEncoding encoding,
                      char indentChar,
                      int indentCount,
                      String newLine)
Construct with specified message encoding and formatting, with default XML declaration containing XML version only.

Parameters:
encoding - the encoding to apply to the message
indentChar - the whitespace character to use for indenting XML.
indentCount - how many indentChars to indent by, disable indentation if negative (zero means new line only)
newLine - sequence of characters used for a line ending (null means use the single character '\n')

MessageOptions

public MessageOptions(XmlEncoding encoding,
                      boolean includeEncodingDecl,
                      Boolean standaloneDecl,
                      char indentChar,
                      int indentCount,
                      String newLine)
Construct with specified message encoding, formatting and XML declaration.

Parameters:
encoding - the encoding to apply to the message
includeEncodingDecl - true to include the encoding in the XML declaration, false omits the encoding in the XML declaration.
standaloneDecl - true to include standalone="yes" in the XML declaration, false to include standalone="no" in the XML declaration, null to exclude the standalone attribute from the XML declaration
indentChar - the whitespace character to use for indenting XML
indentCount - how many indentChars to indent by, disable indentation if negative (zero means new line only)
newLine - sequence of characters used for a line ending (null means use the single character '\n')
Method Detail

getEncoding

public XmlEncoding getEncoding()
Gets the encoding to use for the message.

Returns:
encoding to use

setEncoding

public void setEncoding(XmlEncoding encoding)
Sets the encoding to use for the message.

Parameters:
encoding - to use

getOutMediaTypeCode

public String getOutMediaTypeCode()
Get the media type short code to be used for output.

Returns:
media type short code (e.g. "xml" or "x-xbis")

setOutMediaTypeCode

public void setOutMediaTypeCode(String code)
Set the media type short code to be used for output.

Parameters:
code - media type short code (e.g. "xml" or "x-xbis")

getInMediaTypeCodes

public String[] getInMediaTypeCodes()
Get the media type short code(s) to be accepted for input.

Returns:
accepted media type short codes (e.g. "xml", "x-xbis") (null if unspecified)

setInMediaTypeCodes

public void setInMediaTypeCodes(String[] codes)
Set the media type short code(s) to be accepted for input.

Parameters:
codes - accepted media type short codes (e.g. "xml", "x-xbis") (null if unspecified)

getIndentCount

public int getIndentCount()
Get the number of indent characters to indent the XML by. Disables indentation if negative (zero means new line only).

Returns:
indentCount

setIndentCount

public void setIndentCount(int indentCount)
Set the number of indent characters to indent the XML by. Disables indentation if negative (zero means new line only).

Parameters:
indentCount - the number of indent characters

getIndentChar

public char getIndentChar()
Get the character to use for indenting the XML.

Returns:
indentChar

setIndentChar

public void setIndentChar(char indentChar)
Set the character to use for indenting the XML.

Parameters:
indentChar - the indent character

getNewLine

public String getNewLine()
Get the string to use for new lines.

Returns:
newLine

setNewLine

public void setNewLine(String newLine)
Set the string to use for new lines.

Parameters:
newLine - the new line separator

getStandaloneDecl

public Boolean getStandaloneDecl()
Get the setting for the standalone attribute of the XML declaration.

Returns:
true to include standalone="yes" in the XML declaration, false to include standalone="no" in the XML declaration, null to exclude the standalone attribute from the XML declaration,

setStandaloneDecl

public void setStandaloneDecl(Boolean standaloneDecl)
Set the standalone attribute of the XML declaration.

Parameters:
standaloneDecl - true to include standalone="yes" in the XML declaration, false to include standalone="no" in the XML declaration, null to exclude the standalone attribute from the XML declaration,

isIncludeEncodingDecl

public boolean isIncludeEncodingDecl()
Get the setting for whether to include the encoding attribute in the XML declaration.

Returns:
true to include the encoding in the XML declaration, false to omit the encoding in the XML declaration.

setIncludeEncodingDecl

public void setIncludeEncodingDecl(boolean includeEncodingDecl)
Set whether to include the encoding attribute in the XML declaration.

Parameters:
includeEncodingDecl - true to include the encoding in the XML declaration, false to omit the encoding in the XML declaration.

getEncodingDeclString

public String getEncodingDeclString()
Returns the value of the encoding attribute for the XML declaration.

Returns:
the value of the encoding attribute, null for no encoding attribute.

getStandaloneDeclString

public String getStandaloneDeclString()
Returns the value of the standalone attribute for the XML declaration.

Returns:
the value of the standalone attribute, null for no standalone attribute.

getXmlOptions

public XmlOptions getXmlOptions()
Returns the Xml options for the message.

Returns:
xml formatting options


Project Web Site