public class Whitespace
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static int |
ALL |
|
static int |
COLLAPSE |
|
static int |
IGNORABLE |
|
static int |
NONE |
The values NONE, IGNORABLE, and ALL identify which kinds of whitespace text node
should be stripped when building a source tree
|
static int |
PRESERVE |
The values PRESERVE, REPLACE, and COLLAPSE represent the three options for whitespace
normalization.
|
static int |
REPLACE |
|
static int |
UNSPECIFIED |
Modifier and Type | Method | Description |
---|---|---|
static java.lang.CharSequence |
applyWhitespaceNormalization(int action,
java.lang.CharSequence value) |
Apply schema-defined whitespace normalization to a string
|
static java.lang.CharSequence |
collapseWhitespace(java.lang.CharSequence in) |
Collapse whitespace as defined in XML Schema
|
static boolean |
containsWhitespace(java.lang.CharSequence value) |
Determine if a string contains any whitespace
|
static boolean |
isWhite(java.lang.CharSequence content) |
Determine if a string is all-whitespace
|
static boolean |
isWhitespace(int ch) |
Test whether a character is whitespace
|
static java.lang.CharSequence |
normalizeWhitespace(java.lang.CharSequence in) |
Normalize whitespace as defined in XML Schema
|
static java.lang.CharSequence |
removeAllWhitespace(java.lang.CharSequence value) |
Remove all whitespace characters from a string
|
static java.lang.CharSequence |
removeLeadingWhitespace(java.lang.CharSequence value) |
Remove leading whitespace characters from a string
|
static java.lang.CharSequence |
trimWhitespace(java.lang.CharSequence in) |
Remove leading and trailing whitespace.
|
public static final int PRESERVE
public static final int REPLACE
public static final int COLLAPSE
public static final int NONE
public static final int IGNORABLE
public static final int ALL
public static final int UNSPECIFIED
public static boolean isWhitespace(int ch)
public static java.lang.CharSequence applyWhitespaceNormalization(int action, java.lang.CharSequence value)
action
- the action to be applied: one of PRESERVE, REPLACE, or COLLAPSEvalue
- the value to be normalizedpublic static java.lang.CharSequence removeAllWhitespace(java.lang.CharSequence value)
public static java.lang.CharSequence removeLeadingWhitespace(java.lang.CharSequence value)
public static boolean containsWhitespace(java.lang.CharSequence value)
public static final boolean isWhite(java.lang.CharSequence content)
content
- the string to be testedpublic static java.lang.CharSequence normalizeWhitespace(java.lang.CharSequence in)
public static java.lang.CharSequence collapseWhitespace(java.lang.CharSequence in)
public static java.lang.CharSequence trimWhitespace(java.lang.CharSequence in)
in
- the input string whose whitespace is to be removed