public class Whitespace extends Object
Modifier and Type | Field and 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 |
TRIM |
static int |
UNSPECIFIED |
static int |
XSLT |
Modifier and Type | Method and Description |
---|---|
static CharSequence |
applyWhitespaceNormalization(int action,
CharSequence value)
Apply schema-defined whitespace normalization to a string
|
static CharSequence |
collapseWhitespace(CharSequence in)
Collapse whitespace as defined in XML Schema.
|
static boolean |
containsWhitespace(CharSequence value)
Determine if a string contains any whitespace
|
static boolean |
isWhite(char c)
Determine if a character is whitespace
|
static boolean |
isWhite(CharSequence content)
Determine if a string is all-whitespace
|
static boolean |
isWhitespace(int ch)
Test whether a character is whitespace
|
static CharSequence |
normalizeWhitespace(CharSequence in)
Normalize whitespace as defined in XML Schema.
|
static CharSequence |
removeAllWhitespace(CharSequence value)
Remove all whitespace characters from a string
|
static CharSequence |
removeLeadingWhitespace(CharSequence value)
Remove leading whitespace characters from a string
|
static String |
trim(CharSequence s)
Trim leading and trailing whitespace from a string, returning a string.
|
static CharSequence |
trimWhitespace(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 TRIM
public static final int NONE
public static final int IGNORABLE
public static final int ALL
public static final int UNSPECIFIED
public static final int XSLT
public static boolean isWhitespace(int ch)
ch
- the character (Unicode codepoint) to be testedpublic static CharSequence applyWhitespaceNormalization(int action, CharSequence value)
action
- the action to be applied: one of PRESERVE, REPLACE, or COLLAPSEvalue
- the value to be normalizedpublic static CharSequence removeAllWhitespace(CharSequence value)
value
- the string from which whitespace is to be removedpublic static CharSequence removeLeadingWhitespace(CharSequence value)
value
- the string whose leading whitespace is to be removedpublic static boolean containsWhitespace(CharSequence value)
value
- the string to be testedpublic static boolean isWhite(CharSequence content)
content
- the string to be testedpublic static final boolean isWhite(char c)
c
- the character to be testedpublic static CharSequence normalizeWhitespace(CharSequence in)
collapseWhitespace(java.lang.CharSequence)
methodin
- the string to be normalizedpublic static CharSequence collapseWhitespace(CharSequence in)
in
- the string whose whitespace is to be collapsedpublic static CharSequence trimWhitespace(CharSequence in)
in
- the input string whose whitespace is to be removedpublic static String trim(CharSequence s)
s
- the string to be trimmed. If null is supplied, null is returned.Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.