net.sourceforge.stripes.util
Class StringUtil

java.lang.Object
  extended by net.sourceforge.stripes.util.StringUtil

public class StringUtil
extends Object

Provides utility methods for manipulating and parsing Strings.

Since:
Stripes 1.4.2
Author:
Tim Fennell

Constructor Summary
StringUtil()
           
 
Method Summary
static String combineParts(Object... messageParts)
          Combines a bunch of objects into a single String.
static String[] standardSplit(String input)
          Splits apart the input String on any whitespace and/or commas.
static String uriFragmentEncode(String value)
          Encode a URI fragment as required by RFC 3986.
static String urlDecode(String value)
          URL-decodes value using the UTF-8 charset.
static String urlEncode(String value)
          URL-encodes value using the UTF-8 charset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

standardSplit

public static String[] standardSplit(String input)
Splits apart the input String on any whitespace and/or commas. Leading and trailing whitespace are ignored. If a null String is provided as input a zero length array will be returned.

Parameters:
input - the String to split apart
Returns:
an array of substrings of the input String based on the split

combineParts

public static String combineParts(Object... messageParts)
Combines a bunch of objects into a single String. Array contents get converted nicely.


urlEncode

public static String urlEncode(String value)
URL-encodes value using the UTF-8 charset. Using this method eliminates the need for a try/catch since UTF-8 is guaranteed to exist.

See Also:
URLEncoder.encode(String, String)

urlDecode

public static String urlDecode(String value)
URL-decodes value using the UTF-8 charset. Using this method eliminates the need for a try/catch since UTF-8 is guaranteed to exist.

See Also:
URLDecoder.decode(String, String)

uriFragmentEncode

public static String uriFragmentEncode(String value)
Encode a URI fragment as required by RFC 3986. The fragment is allowed to contain a different set of characters than other parts of the URI, and characters that are allowed in the fragment must not be encoded.

Parameters:
value - The string to encode
Returns:
The encoded string


? Copyright 2005-2006, Stripes Development Team.