org.apache.turbine.util
Class StringUtils

java.lang.Object
  extended byorg.apache.turbine.util.StringUtils

Deprecated. This class will be removed after the 2.3 release. Please use the commons-lang component.

public class StringUtils
extends java.lang.Object

This is where common String manipulation routines should go.

Version:
$Id: StringUtils.java 264148 2005-08-29 14:21:04Z henning $
Author:
Eric Pugh, Jon S. Stevens, Daniel Rall, Greg Coladonato, Quinton McCombs

Field Summary
static int PPKEY_CLASSNAME
          Deprecated.  
static int PPKEY_ID
          Deprecated.  
static int PPKEY_PROPERTY
          Deprecated.  
 
Constructor Summary
StringUtils()
          Deprecated.  
 
Method Summary
static boolean equals(java.lang.String s1, java.lang.String s2)
          Deprecated. use org.apache.commons.lang.StringUtils.equals() instead
static java.lang.String firstLetterCaps(java.lang.String data)
          Deprecated. use org.apache.commons.lang.StringUtils.capitalise() instead
static boolean isEmpty(java.lang.String foo)
          Deprecated. use org.apache.commons.lang.StringUtils.isEmpty() instead
static boolean isValid(java.lang.String foo)
          Deprecated. Use org.apache.commons.lang.StringUtils.isNotEmpty()
static java.lang.String join(java.lang.String[] list, java.lang.String separator)
          Deprecated. Use org.apache.commons.lang.StringUtils.join()
static java.lang.String makeString(java.lang.String foo)
          Deprecated. Use org.apache.commons.lang.StringUtils.defaultString()
static java.lang.String[] parseObjectKey(java.lang.String s)
          Deprecated. Takes a String of the form substring[substring]subtring and returns the 3 substrings
static java.lang.String removeUnderScores(java.lang.String data)
          Deprecated. Remove Underscores from a string and replaces first Letters with Capitals.
static java.lang.String[] split(java.lang.String text, java.lang.String separator)
          Deprecated. use org.apache.commons.lang.StringUtils.split() instead
static java.lang.String stackTrace(java.lang.Throwable e)
          Deprecated. use org.apache.commons.lang.ExceptionUtils.getStackTrace() instead
static java.lang.String stackTrace(java.lang.Throwable e, boolean addPre)
          Deprecated. Returns the output of printStackTrace as a String.
protected static java.lang.String wrapLine(java.lang.String line, java.lang.String newline, int wrapColumn)
          Deprecated. Wraps a single line of text.
static java.lang.String wrapText(java.lang.String inString, java.lang.String newline, int wrapColumn)
          Deprecated. Takes a block of text which might have long lines in it and wraps the long lines based on the supplied wrapColumn parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PPKEY_CLASSNAME

public static final int PPKEY_CLASSNAME
Deprecated. 
See Also:
Constant Field Values

PPKEY_ID

public static final int PPKEY_ID
Deprecated. 
See Also:
Constant Field Values

PPKEY_PROPERTY

public static final int PPKEY_PROPERTY
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

StringUtils

public StringUtils()
Deprecated. 
Method Detail

makeString

public static final java.lang.String makeString(java.lang.String foo)
Deprecated. Use org.apache.commons.lang.StringUtils.defaultString()

Deal with null strings converting them to "" instead. It also invokes String.trim() on the output.

Parameters:
foo - A String.
Returns:
A String.

isValid

public static final boolean isValid(java.lang.String foo)
Deprecated. Use org.apache.commons.lang.StringUtils.isNotEmpty()

Validates that the supplied string is neither null nor the empty string.

Parameters:
foo - The text to check.
Returns:
Whether valid.

isEmpty

public static final boolean isEmpty(java.lang.String foo)
Deprecated. use org.apache.commons.lang.StringUtils.isEmpty() instead

Determine whether a (trimmed) string is empty

Parameters:
foo - The text to check.
Returns:
Whether empty.

stackTrace

public static final java.lang.String stackTrace(java.lang.Throwable e)
Deprecated. use org.apache.commons.lang.ExceptionUtils.getStackTrace() instead

Returns the output of printStackTrace as a String.

Parameters:
e - A Throwable.
Returns:
A String.

stackTrace

public static final java.lang.String stackTrace(java.lang.Throwable e,
                                                boolean addPre)
Deprecated. 
Returns the output of printStackTrace as a String.

Parameters:
e - A Throwable.
addPre - a boolean to add HTML
 tags around the stacktrace
Returns:
A String.

equals

public static boolean equals(java.lang.String s1,
                             java.lang.String s2)
Deprecated. use org.apache.commons.lang.StringUtils.equals() instead

Compares two Strings, returns true if their values are the same.

Parameters:
s1 - The first string.
s2 - The second string.
Returns:
True if the values of both strings are the same.

parseObjectKey

public static java.lang.String[] parseObjectKey(java.lang.String s)
Deprecated. 
Takes a String of the form substring[substring]subtring and returns the 3 substrings

Returns:
a three element String array

removeUnderScores

public static java.lang.String removeUnderScores(java.lang.String data)
Deprecated. 
Remove Underscores from a string and replaces first Letters with Capitals. foo_bar becomes FooBar


firstLetterCaps

public static java.lang.String firstLetterCaps(java.lang.String data)
Deprecated. use org.apache.commons.lang.StringUtils.capitalise() instead

Makes the first letter caps and leaves the rest as is.


split

public static java.lang.String[] split(java.lang.String text,
                                       java.lang.String separator)
Deprecated. use org.apache.commons.lang.StringUtils.split() instead

Splits the provided CSV text into a list.

Parameters:
text - The CSV list of values to split apart.
separator - The separator character.
Returns:
The list of values.

join

public static java.lang.String join(java.lang.String[] list,
                                    java.lang.String separator)
Deprecated. Use org.apache.commons.lang.StringUtils.join()

Joins the elements of the provided array into a single string containing a list of CSV elements.

Parameters:
list - The list of values to join together.
separator - The separator character.
Returns:
The CSV text.

wrapText

public static java.lang.String wrapText(java.lang.String inString,
                                        java.lang.String newline,
                                        int wrapColumn)
Deprecated. 
Takes a block of text which might have long lines in it and wraps the long lines based on the supplied wrapColumn parameter. It was initially implemented for use by VelocityEmail. If there are tabs in inString, you are going to get results that are a bit strange, since tabs are a single character but are displayed as 4 or 8 spaces. Remove the tabs.

Parameters:
inString - Text which is in need of word-wrapping.
newline - The characters that define a newline.
wrapColumn - The column to wrap the words at.
Returns:
The text with all the long lines word-wrapped.

wrapLine

protected static java.lang.String wrapLine(java.lang.String line,
                                           java.lang.String newline,
                                           int wrapColumn)
Deprecated. 
Wraps a single line of text. Called by wrapText(). I can't think of any good reason for exposing this to the public, since wrapText should always be used AFAIK.

Parameters:
line - A line which is in need of word-wrapping.
newline - The characters that define a newline.
wrapColumn - The column to wrap the words at.
Returns:
A line with newlines inserted.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.