Main Page | Class Hierarchy | Class List | Class Members

org::jdom::output::Format Class Reference

List of all members.

Public Member Functions

Format setEscapeStrategy (EscapeStrategy strategy)
EscapeStrategy getEscapeStrategy ()
Format setLineSeparator (String separator)
String getLineSeparator ()
Format setOmitEncoding (boolean omitEncoding)
boolean getOmitEncoding ()
Format setOmitDeclaration (boolean omitDeclaration)
boolean getOmitDeclaration ()
Format setExpandEmptyElements (boolean expandEmptyElements)
boolean getExpandEmptyElements ()
void setIgnoreTrAXEscapingPIs (boolean ignoreTrAXEscapingPIs)
boolean getIgnoreTrAXEscapingPIs ()
Format setTextMode (Format.TextMode mode)
Format.TextMode getTextMode ()
Format setIndent (String indent)
String getIndent ()
Format setEncoding (String encoding)
String getEncoding ()

Static Public Member Functions

Format getRawFormat ()
Format getPrettyFormat ()
Format getCompactFormat ()

Protected Member Functions

Object clone ()

Package Attributes

String indent = null
String lineSeparator = STANDARD_LINE_SEPARATOR
String encoding = STANDARD_ENCODING
boolean omitDeclaration = false
boolean omitEncoding = false
boolean expandEmptyElements = false
boolean ignoreTrAXEscapingPIs = false
TextMode mode = TextMode.PRESERVE
EscapeStrategy escapeStrategy = new DefaultEscapeStrategy(encoding)

Detailed Description

Class to encapsulate XMLOutputter format options. Typical users can use the standard format configurations obtained by getRawFormat (no whitespace changes), getPrettyFormat (whitespace beautification), and getCompactFormat (whitespace normalization).

Several modes are available to effect the way textual content is printed. See the documentation for TextMode for details.

Version:
Revision
1.10
,
Date
2004/09/07 06:37:20
Author:
Jason Hunter


Member Function Documentation

Format org::jdom::output::Format::getCompactFormat  )  [inline, static]
 

Returns a new Format object that performs whitespace normalization, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. Tweaks can be made to the returned Format instance without affecting other instances.

Returns:
a Format with whitespace normalization

String org::jdom::output::Format::getEncoding  )  [inline]
 

Returns the configured output encoding.

Returns:
the output encoding

EscapeStrategy org::jdom::output::Format::getEscapeStrategy  )  [inline]
 

Returns the current escape strategy

Returns:
the current escape strategy

boolean org::jdom::output::Format::getExpandEmptyElements  )  [inline]
 

Returns whether empty elements are expanded.

Returns:
whether empty elements are expanded

boolean org::jdom::output::Format::getIgnoreTrAXEscapingPIs  )  [inline]
 

Returns whether JAXP TrAX processing instructions for disabling/enabling output escaping are ignored.

Returns:
whether or not TrAX ouput escaping PIs are ignored.

String org::jdom::output::Format::getIndent  )  [inline]
 

Returns the indent string in use.

Returns:
the indent string in use

String org::jdom::output::Format::getLineSeparator  )  [inline]
 

Returns the current line separator.

Returns:
the current line separator

boolean org::jdom::output::Format::getOmitDeclaration  )  [inline]
 

Returns whether the XML declaration will be omitted.

Returns:
whether the XML declaration will be omitted

boolean org::jdom::output::Format::getOmitEncoding  )  [inline]
 

Returns whether the XML declaration encoding will be omitted.

Returns:
whether the XML declaration encoding will be omitted

Format org::jdom::output::Format::getPrettyFormat  )  [inline, static]
 

Returns a new Format object that performs whitespace beautification with 2-space indents, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. Tweaks can be made to the returned Format instance without affecting other instances.

Returns:
a Format with whitespace beautification

Format org::jdom::output::Format::getRawFormat  )  [inline, static]
 

Returns a new Format object that performs no whitespace changes, uses the UTF-8 encoding, doesn't expand empty elements, includes the declaration and encoding, and uses the default entity escape strategy. Tweaks can be made to the returned Format instance without affecting other instances.

Returns:
a Format with no whitespace changes

Format.TextMode org::jdom::output::Format::getTextMode  )  [inline]
 

Returns the current text output style.

Returns:
the current text output style

Format org::jdom::output::Format::setEncoding String  encoding  )  [inline]
 

Sets the output encoding. The name should be an accepted XML encoding.

Parameters:
encoding the encoding format. Use XML-style names like "UTF-8" or "ISO-8859-1" or "US-ASCII"
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setEscapeStrategy EscapeStrategy  strategy  )  [inline]
 

Sets the EscapeStrategy to use for character escaping.

Parameters:
strategy the EscapeStrategy to use
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setExpandEmptyElements boolean  expandEmptyElements  )  [inline]
 

This will set whether empty elements are expanded from <tagName/> to <tagName></tagName>.

Parameters:
expandEmptyElements boolean indicating whether or not empty elements should be expanded.
Returns:
a pointer to this Format for chaining

void org::jdom::output::Format::setIgnoreTrAXEscapingPIs boolean  ignoreTrAXEscapingPIs  )  [inline]
 

This will set whether JAXP TrAX processing instructions for disabling/enabling output escaping are ignored. Disabling output escaping allows using XML text as element content and outputing it verbatim, i&#46;e&#46; as element children would be.

When processed, these processing instructions are removed from the generated XML text and control whether the element text content is output verbatim or with escaping of the pre-defined entities in XML 1.0. The text to be output verbatim shall be surrounded by the <?javax.xml.transform.disable-output-escaping ?> and <?javax.xml.transform.enable-output-escaping ?> PIs.

When ignored, the processing instructions are present in the generated XML text and the pre-defined entities in XML 1.0 are escaped.

Default: false.

Parameters:
ignoreTrAXEscapingPIs boolean indicating whether or not TrAX ouput escaping PIs are ignored.
See also:
javax.xml.transform.Result#PI_ENABLE_OUTPUT_ESCAPING

javax.xml.transform.Result#PI_DISABLE_OUTPUT_ESCAPING

Format org::jdom::output::Format::setIndent String  indent  )  [inline]
 

This will set the indent String to use; this is usually a String of empty spaces. If you pass null, or the empty string (""), then no indentation will happen. Default: none (null)

Parameters:
indent String to use for indentation.
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setLineSeparator String  separator  )  [inline]
 

This will set the newline separator (lineSeparator). The default is
. Note that if the "newlines" property is false, this value is irrelevant. To make it output the system default line ending string, call setLineSeparator(System.getProperty("line.separator"))

To output "UNIX-style" documents, call setLineSeparator("\n"). To output "Mac-style" documents, call setLineSeparator("\r"). DOS-style documents use CR-LF ("\r\n"), which is the default.

Note that this only applies to newlines generated by the outputter. If you parse an XML document that contains newlines embedded inside a text node, and you do not set TextMode.NORMALIZE, then the newlines will be output verbatim, as "\n" which is how parsers normalize them.

See also:
setTextMode
Parameters:
separator String line separator to use.
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setOmitDeclaration boolean  omitDeclaration  )  [inline]
 

This will set whether the XML declaration (<&#063;xml version="1&#046;0"&#063;gt;) will be omitted or not. It is common to omit this in uses such as SOAP and XML-RPC calls.

Parameters:
omitDeclaration boolean indicating whether or not the XML declaration should be omitted.
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setOmitEncoding boolean  omitEncoding  )  [inline]
 

This will set whether the XML declaration (<&#063;xml version="1&#046;0" encoding="UTF-8"&#063;>) includes the encoding of the document. It is common to omit this in uses such as WML and other wireless device protocols.

Parameters:
omitEncoding boolean indicating whether or not the XML declaration should indicate the document encoding.
Returns:
a pointer to this Format for chaining

Format org::jdom::output::Format::setTextMode Format.TextMode  mode  )  [inline]
 

This sets the text output style. Options are available as static TextMode instances. The default is TextMode#PRESERVE.

Returns:
a pointer to this Format for chaining


Member Data Documentation

String org::jdom::output::Format::encoding = STANDARD_ENCODING [package]
 

The encoding format

EscapeStrategy org::jdom::output::Format::escapeStrategy = new DefaultEscapeStrategy(encoding) [package]
 

entity escape logic

boolean org::jdom::output::Format::expandEmptyElements = false [package]
 

Whether or not to expand empty elements to <tagName></tagName> - default is false

boolean org::jdom::output::Format::ignoreTrAXEscapingPIs = false [package]
 

Whether TrAX output escaping disabling/enabling PIs are ignored or processed - default is false

String org::jdom::output::Format::indent = null [package]
 

The default indent is no spaces (as original document)

String org::jdom::output::Format::lineSeparator = STANDARD_LINE_SEPARATOR [package]
 

New line separator

TextMode org::jdom::output::Format::mode = TextMode.PRESERVE [package]
 

text handling mode

boolean org::jdom::output::Format::omitDeclaration = false [package]
 

Whether or not to output the XML declaration

  • default is false

boolean org::jdom::output::Format::omitEncoding = false [package]
 

Whether or not to output the encoding in the XML declaration

  • default is false


The documentation for this class was generated from the following file:
Generated on Thu Dec 9 10:42:05 2004 for JDOM by  doxygen 1.3.9.1