Enhydra 3.0.3 API

org.enhydra.xml.io
Class OutputOptions

java.lang.Object
  |
  +--org.enhydra.xml.io.OutputOptions

public class OutputOptions
extends java.lang.Object

Object that specifis how a XML file will be formatted.


Constructor Summary
OutputOptions()
           
 
Method Summary
 boolean getDropHtmlSpanIds()
          Get the drop HTML SPAN element ids flag.
 boolean getIndenting()
          Get indentation enabled state.
 int getIndentSize()
          Get indentation size.
 java.lang.String getJavaEncoding()
          Get the Java encoding.
 int getLineWidth()
          Get the width at while long lines are split when indentation is enabled.
 boolean getOmitEncoding()
          Get flag indicating if encoding should be omitted from the XML header.
 boolean getPreserveSpace()
          Get the default space-preservation flag.
 java.lang.String getXmlEncoding()
          Get the XML encoding.
 void setDropHtmlSpanIds(boolean drop)
          Set the drop HTML SPAN element ids flag.
 void setIndenting(boolean enable)
          Enable or disable indentation.
 void setIndentSize(int size)
          Set indentation size.
 void setJavaEncoding(java.lang.String newJavaEncoding)
          Set the encoding using the Java encoding name.
 void setLineWidth(int width)
          Set the width at while long lines are split when indentation is enabled.
 void setOmitEncoding(boolean omit)
          Set flag indicating if encoding should be omitted from the XML header.
 void setPreserveSpace(boolean preserve)
          Set the default space-preservation flag.
 void setXmlEncoding(java.lang.String newXmlEncoding)
          Set the encoding using the XML encoding name.
 void setXmlEncoding(java.lang.String newJavaEncoding, java.lang.String newXmlEncoding)
          Set both the XML and Java encodings.
 java.lang.String toString()
          Convert to a string for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OutputOptions

public OutputOptions()
Method Detail

getJavaEncoding

public java.lang.String getJavaEncoding()
Get the Java encoding.
Returns:
The encoding or null if not specified.

setJavaEncoding

public void setJavaEncoding(java.lang.String newJavaEncoding)
Set the encoding using the Java encoding name. This sets the corresponding XML encoding name.
Parameters:
newJavaEncoding - the new Java encoding or null to set to default.
Throws:
XMLIOError - if the encoding can't be converted to a XML encoding.

getXmlEncoding

public java.lang.String getXmlEncoding()
Get the XML encoding.
Returns:
The encoding or null if not specified.

setXmlEncoding

public void setXmlEncoding(java.lang.String newXmlEncoding)
Set the encoding using the XML encoding name. This sets the corresponding Java encoding name.
Parameters:
newXmlEncoding - the new XML encoding or null to set to default.
Throws:
XMLIOError - if the encoding can't be converted to a Java encoding.

setXmlEncoding

public void setXmlEncoding(java.lang.String newJavaEncoding,
                           java.lang.String newXmlEncoding)
Set both the XML and Java encodings. This allows setting the encodings were a mapping is not defined.
Parameters:
newJavaEncoding - the new Java encoding or null to set to default.
newXmlEncoding - the new XML encoding or null to set to default.
Throws:
XMLIOError - If one of the encodings, but not both are null.

getIndenting

public boolean getIndenting()
Get indentation enabled state.
Returns:
true if enable, false to disable. The default is disabled.

setIndenting

public void setIndenting(boolean enable)
Enable or disable indentation.
Parameters:
enable - true to enable, false to disable.

getIndentSize

public int getIndentSize()
Get indentation size.
Returns:
Number of characters to indent at each level.

setIndentSize

public void setIndentSize(int size)
Set indentation size.
Parameters:
size - Number of characters to indent at each level.

getLineWidth

public int getLineWidth()
Get the width at while long lines are split when indentation is enabled. The default is 72.

setLineWidth

public void setLineWidth(int width)
Set the width at while long lines are split when indentation is enabled.
Parameters:
width - the new line width

getPreserveSpace

public boolean getPreserveSpace()
Get the default space-preservation flag.
Returns:
true if preserving space where not otherwise specified by the document, false otherwise. The default is true.

setPreserveSpace

public void setPreserveSpace(boolean preserve)
Set the default space-preservation flag.
Parameters:
perserve - true if preserving space where not otherwise specified by the document

getOmitEncoding

public boolean getOmitEncoding()
Get flag indicating if encoding should be omitted from the XML header.

setOmitEncoding

public void setOmitEncoding(boolean omit)
Set flag indicating if encoding should be omitted from the XML header. This is provided as a hack for WML. Several devices need ASCII encoding but can't handle the header.

getDropHtmlSpanIds

public boolean getDropHtmlSpanIds()
Get the drop HTML SPAN element ids flag.

setDropHtmlSpanIds

public void setDropHtmlSpanIds(boolean drop)
Set the drop HTML SPAN element ids flag.

toString

public java.lang.String toString()
Convert to a string for debugging.
Overrides:
toString in class java.lang.Object

Enhydra 3.0.3 API