org.jibx.ws.io
Class XmlOptions

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

public final class XmlOptions
extends Object

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


Constructor Summary
XmlOptions()
          Default constructor for UTF-8, with no formatting and XML declaration containing XML version only.
XmlOptions(char indentChar, int indentCount, String newLine)
          Construct with message formatting details.
XmlOptions(XmlEncoding encoding)
          Construct with specified encoding, no formatting and XML declaration containing XML version only.
XmlOptions(XmlEncoding encoding, boolean includeEncodingDecl, Boolean standaloneDecl)
          Construct with specified encoding and XML declaration, with no formatting.
XmlOptions(XmlEncoding encoding, boolean includeEncodingDecl, Boolean standaloneDecl, char indentChar, int indentCount, String newLine)
          Construct with specified message encoding, formatting and XML declaration.
XmlOptions(XmlEncoding encoding, char indentChar, int indentCount, String newLine)
          Construct with specified message encoding and formatting, with default XML declaration containing XML version only.
XmlOptions(XmlOptions options)
          Copy constructor.
 
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 getNewLine()
          Get the string to use for new lines.
 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.
 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 setNewLine(String newLine)
          Set the string to use for new lines.
 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

XmlOptions

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


XmlOptions

public XmlOptions(XmlOptions options)
Copy constructor.

Parameters:
options - the options to copy

XmlOptions

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

Parameters:
encoding - the encoding to apply to the message

XmlOptions

public XmlOptions(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,

XmlOptions

public XmlOptions(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')

XmlOptions

public XmlOptions(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')

XmlOptions

public XmlOptions(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

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.


Project Web Site