Package org.jdom.output
Class Format.TextMode
- java.lang.Object
-
- org.jdom.output.Format.TextMode
-
- Enclosing class:
- Format
public static class Format.TextMode extends java.lang.ObjectClass to signify how text should be handled on output. The following table provides details.
In most cases textual content is aligned with the surrounding tags (after the appropriate text mode is applied). In the case where the only content between the start and end tags is textual, the start tag, text, and end tag are all printed on the same line. If the document being output already has whitespace, it's wise to turn on TRIM mode so the pre-existing whitespace can be trimmed before adding new whitespace.Text Mode Resulting behavior. PRESERVE (Default) All content is printed in the format it was created, no whitespace or line separators are are added or removed. TRIM_FULL_WHITE Content between tags consisting of all whitespace is not printed. If the content contains even one non-whitespace character, it is printed verbatim, whitespace and all. TRIM Same as TrimAllWhite, plus leading/trailing whitespace are trimmed. NORMALIZE Same as TextTrim, plus addition interior whitespace is compressed to a single space. When a element has a xml:space attribute with the value of "preserve", all formating is turned off and reverts back to the default until the element and its contents have been printed. If a nested element contains another xml:space with the value "default" formatting is turned back on for the child element and then off for the remainder of the parent element.
-
-
Field Summary
Fields Modifier and Type Field Description static Format.TextModeNORMALIZEMode for text normalization (left and right trim plus internal whitespace is normalized to a single space.static Format.TextModePRESERVEMode for literal text preservation.static Format.TextModeTRIMMode for text trimming (left and right trim).static Format.TextModeTRIM_FULL_WHITEMode for text trimming of content consisting of nothing but whitespace but otherwise not changing output.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()
-
-
-
Field Detail
-
PRESERVE
public static final Format.TextMode PRESERVE
Mode for literal text preservation.
-
TRIM
public static final Format.TextMode TRIM
Mode for text trimming (left and right trim).
-
NORMALIZE
public static final Format.TextMode NORMALIZE
Mode for text normalization (left and right trim plus internal whitespace is normalized to a single space.- See Also:
Element.getTextNormalize()
-
TRIM_FULL_WHITE
public static final Format.TextMode TRIM_FULL_WHITE
Mode for text trimming of content consisting of nothing but whitespace but otherwise not changing output.
-
-