public static enum Format.TextMode extends java.lang.Enum<Format.TextMode>
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 all printed verbatim, whitespace and all. |
TRIM | All leading and trailing whitespace is trimmed. |
NORMALIZE | Leading and trailing whitespace is trimmed, and any 'internal' whitespace is compressed to a single space. |
When an element has a xml:space attribute with the value of "preserve",
all formatting is turned off (actually, the TextMode is set to
PRESERVE
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.
Enum Constant and Description |
---|
NORMALIZE
Mode for text normalization (left and right trim plus internal
whitespace is normalized to a single space.
|
PRESERVE
Mode for literal text preservation.
|
TRIM
Mode for text trimming (left and right trim).
|
TRIM_FULL_WHITE
Mode for text trimming of content consisting of nothing but
whitespace but otherwise not changing output.
|
Modifier and Type | Method and Description |
---|---|
static Format.TextMode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Format.TextMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Format.TextMode PRESERVE
public static final Format.TextMode TRIM
public static final Format.TextMode NORMALIZE
Element.getTextNormalize()
public static final Format.TextMode TRIM_FULL_WHITE
public static Format.TextMode[] values()
for (Format.TextMode c : Format.TextMode.values()) System.out.println(c);
public static Format.TextMode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullCopyright © 2021 Jason Hunter, Brett McLaughlin. All Rights Reserved.