All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.kvisco.xml.Whitespace

com.kvisco.xml.Whitespace

public class Whitespace
A class for handling XML Whitespace

Author:
Keith Visco

Variable Index

 o CR
Carriage Return character Changed to '\r' instead of ' ' to make compatible with MS J++ Mohan Embar
 o EMPTY
Empty String
 o LF
Linefeed character
 o NULL
Null character
 o SPACE
Single space character
 o TAB
Tab character

Constructor Index

 o Whitespace()

Method Index

 o stripSpace(String)
Strips whitespace from the given String.
 o stripSpace(String, boolean, boolean)
Strips whitespace from the given String.

Variables

 o NULL
 public static final char NULL
Null character

 o SPACE
 public static final char SPACE
Single space character

 o TAB
 public static final char TAB
Tab character

 o CR
 public static final char CR
Carriage Return character Changed to '\r' instead of ' ' to make compatible with MS J++ Mohan Embar

 o LF
 public static final char LF
Linefeed character

 o EMPTY
 public static final String EMPTY
Empty String

Constructors

 o Whitespace
 public Whitespace()

Methods

 o stripSpace
 public static String stripSpace(String data)
Strips whitespace from the given String. Newlines (#xD), tabs (#x9), and consecutive spaces (#x20) are converted to a single space (#x20). This method is useful for processing consective Strings since any leading spaces will be converted to a single space.

Parameters:
data - the String to strip whitespace from
 o stripSpace
 public static String stripSpace(String data,
                                 boolean stripAllLeadSpace,
                                 boolean stripAllTrailSpace)
Strips whitespace from the given String. Newlines (#xD), tabs (#x9), and consecutive spaces (#x20) are converted to a single space (#x20).

Parameters:
data - the String to strip whitespace from
stripAllLeadSpace, - a boolean indicating whether or not to strip all leading space. If true all whitespace from the start of the given String will be stripped. If false, all whitespace from the start of the given String will be converted to a single space.
stripAllTrailSpace, - a boolean indicating whether or not to strip all trailing space. If true all whitespace at the end of the given String will be stripped. If false, all whitespace at the end of the given String will be converted to a single space.

All Packages  Class Hierarchy  This Package  Previous  Next  Index