Package org.jibx.runtime
Class WhitespaceConversions
- java.lang.Object
-
- org.jibx.runtime.WhitespaceConversions
-
public final class WhitespaceConversions extends java.lang.ObjectUtilities for handling whitespace options.- Author:
- Dennis M. Sosnoski
-
-
Constructor Summary
Constructors Modifier Constructor Description privateWhitespaceConversions()Non-constructor for class with no instances.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringcollapse(java.lang.String text)Collapse whitespace in string.private static java.lang.StringconvertCollapsed(java.lang.String text, int index)Convert string value to whitespace-collapsed form.private static java.lang.StringconvertReplaced(java.lang.String text, int index)Convert string value to whitespace-replaced form.static java.lang.Stringreplace(java.lang.String text)Replace non-space whitespace in string.static java.lang.Stringtrim(java.lang.String text)Trim leading and trailing whitespace in string.
-
-
-
Method Detail
-
convertReplaced
private static java.lang.String convertReplaced(java.lang.String text, int index)Convert string value to whitespace-replaced form. The first character to be replaced must have been found prior to this call.- Parameters:
text- value to be convertedindex- first character offset to be dropped from result- Returns:
- collapsed string value
-
replace
public static java.lang.String replace(java.lang.String text)
Replace non-space whitespace in string. This first scans to see if any non-space whitespace is present, and if so, invokes the actual conversion handling.- Parameters:
text- value to be converted (nullif none)- Returns:
- replaced string value (
nullif none)
-
convertCollapsed
private static java.lang.String convertCollapsed(java.lang.String text, int index)Convert string value to whitespace-collapsed form. The first whitespace character must have been found prior to this call.- Parameters:
text- value to be convertedindex- first character offset to be dropped from result- Returns:
- collapsed string value
-
collapse
public static java.lang.String collapse(java.lang.String text)
Collapse whitespace in string. This first scans to see if any whitespace is present, and if so, invokes the actual conversion handling.- Parameters:
text- value to be converted (nullif none)- Returns:
- collapsed string value (
nullif none)
-
trim
public static java.lang.String trim(java.lang.String text)
Trim leading and trailing whitespace in string.- Parameters:
text- value to be converted (nullif none)- Returns:
- trimmed string value (
nullif none)
-
-