Package org.jibx.runtime
Class WhitespaceConversions
java.lang.Object
org.jibx.runtime.WhitespaceConversions
Utilities for handling whitespace options.
- Author:
- Dennis M. Sosnoski
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Non-constructor for class with no instances. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Collapse whitespace in string.private static String
convertCollapsed
(String text, int index) Convert string value to whitespace-collapsed form.private static String
convertReplaced
(String text, int index) Convert string value to whitespace-replaced form.static String
Replace non-space whitespace in string.static String
Trim leading and trailing whitespace in string.
-
Constructor Details
-
WhitespaceConversions
private WhitespaceConversions()Non-constructor for class with no instances.
-
-
Method Details
-
convertReplaced
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
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 (null
if none)- Returns:
- replaced string value (
null
if none)
-
convertCollapsed
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
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 (null
if none)- Returns:
- collapsed string value (
null
if none)
-
trim
Trim leading and trailing whitespace in string.- Parameters:
text
- value to be converted (null
if none)- Returns:
- trimmed string value (
null
if none)
-