|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ctc.wstx.util.StringUtil
public final class StringUtil
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static void |
appendLF(StringBuffer sb)
|
static String |
concatEntries(Collection coll,
String sep,
String lastSep)
|
static boolean |
encodingStartsWith(String enc,
String prefix)
|
static boolean |
equalEncodings(String str1,
String str2)
Method that implements a loose String compairon for encoding Strings. |
static String |
getLF()
|
static boolean |
isAllWhitespace(char[] ch,
int start,
int len)
|
static boolean |
isAllWhitespace(String str)
|
static boolean |
isSpace(char c)
Note that it is assumed that any "weird" white space (xml 1.1 LSEP and NEL) have been replaced by canonical alternatives (linefeed for element content, regular space for attributes) |
static boolean |
matches(String str,
char[] cbuf,
int offset,
int len)
|
static String |
normalizeSpaces(char[] buf,
int origStart,
int origEnd)
Method that will check character array passed, and remove all "extra" spaces (leading and trailing space), and normalize other white space (more than one consequtive space character replaced with a single space). |
static String |
trimEncoding(String str,
boolean upperCase)
Method that will remove all non-alphanumeric characters, and optionally upper-case included letters, from the given String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static String getLF()
public static void appendLF(StringBuffer sb)
public static String concatEntries(Collection coll, String sep, String lastSep)
public static String normalizeSpaces(char[] buf, int origStart, int origEnd)
NOTE: we only remove explicit space characters (char code 0x0020); the reason being that other white space must have come from non-normalizable sources, ie. via entity expansion, and is thus not to be normalized
buf
- Buffer that contains the String to checkorigStart
- Offset of the first character of the text to check
in the bufferorigEnd
- Offset of the character following the last character
of the text (as per usual Java API convention)
public static boolean isAllWhitespace(String str)
public static boolean isAllWhitespace(char[] ch, int start, int len)
public static boolean equalEncodings(String str1, String str2)
String.equalsIgnoreCase(java.lang.String)
,
except that it will also ignore all hyphen, underscore and
space characters.
public static boolean encodingStartsWith(String enc, String prefix)
public static String trimEncoding(String str, boolean upperCase)
public static boolean matches(String str, char[] cbuf, int offset, int len)
public static final boolean isSpace(char c)
Note that it is assumed that any "weird" white space (xml 1.1 LSEP and NEL) have been replaced by canonical alternatives (linefeed for element content, regular space for attributes)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |