org.apache.pluto.util
Class StringUtils

java.lang.Object
  extended by org.apache.pluto.util.StringUtils

public class StringUtils
extends java.lang.Object

StringUtils hosts a couple of utility methods around strings.


Field Summary
static java.lang.String lineSeparator
          The operating system's line separator ('\n' on UNIX, '\r\n' on Windows)
 
Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.Boolean booleanOf(java.lang.String aValue)
          Returns a Boolean object that corresponds the given value.
static java.lang.String[] copy(java.lang.String[] source)
           
static java.util.Map copyParameters(java.util.Map parameters)
           
static java.lang.String decode(java.lang.String s)
           
static java.lang.String encode(java.lang.String s)
           
static void indent(java.lang.StringBuffer buffer, int indent)
           
static java.lang.String nameOf(java.lang.Class aClass)
          Returns the short name of the specified class.
static void newLine(java.lang.StringBuffer buffer, int indent)
           
static java.lang.String packageOf(java.lang.Class aClass)
          Returns the name of the package of the specified class.
static java.lang.String pathOf(java.lang.String aRoot, java.lang.String aPath)
          Returns a combination of two paths, inserting slashes as appropriate.
static java.lang.String replace(java.lang.String source, java.lang.String pattern, java.lang.String replace)
          Replace all occurrences of a pattern within a string by a replacement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lineSeparator

public static final java.lang.String lineSeparator
The operating system's line separator ('\n' on UNIX, '\r\n' on Windows)

Constructor Detail

StringUtils

public StringUtils()
Method Detail

packageOf

public static java.lang.String packageOf(java.lang.Class aClass)
Returns the name of the package of the specified class. The package will not include the common (short) name of the class or the file extension.

Parameters:
aClass - a class object
Returns:
its package

nameOf

public static java.lang.String nameOf(java.lang.Class aClass)
Returns the short name of the specified class. The name will not include the package name or file extension.

Parameters:
aClass - a class object
Returns:
its name

pathOf

public static java.lang.String pathOf(java.lang.String aRoot,
                                      java.lang.String aPath)
Returns a combination of two paths, inserting slashes as appropriate.

Parameters:
aRoot - a root path
aPath - a path
Returns:
the path

booleanOf

public static java.lang.Boolean booleanOf(java.lang.String aValue)
Returns a Boolean object that corresponds the given value. A value of true or yes corresponds to Boolean.TRUE and a value of false or no corresponds to Boolean.FALSE. The comparions is case-insensitive, but for performance reasons, lower-case values of true and false should be used.

Parameters:
aValue - to value to convert
Returns:
the boolean value

replace

public static java.lang.String replace(java.lang.String source,
                                       java.lang.String pattern,
                                       java.lang.String replace)
Replace all occurrences of a pattern within a string by a replacement

Parameters:
source - The string that should be searched
pattern - The pattern that should be replaced
replace - The replacement that should be inserted instead of the pattern
Returns:
The updated source string

newLine

public static void newLine(java.lang.StringBuffer buffer,
                           int indent)

indent

public static void indent(java.lang.StringBuffer buffer,
                          int indent)

encode

public static java.lang.String encode(java.lang.String s)

decode

public static java.lang.String decode(java.lang.String s)

copy

public static java.lang.String[] copy(java.lang.String[] source)

copyParameters

public static java.util.Map copyParameters(java.util.Map parameters)


Copyright © 2003-2011 . All Rights Reserved.