net.fortuna.ical4j.util

Class Strings


public final class Strings
extends java.lang.Object

$Id: Strings.java,v 1.8 2008/12/16 12:34:53 fortuna Exp $ [23-Apr-2004] Utility methods for working with parameters.

Field Summary

static String
LINE_SEPARATOR
A string used to denote the start (and end) of iCalendar content lines.
static Pattern
PARAM_QUOTE_PATTERN
Defines a regular expression representing all parameter strings that should be quoted.

Method Summary

static String
escape(String aValue)
Convenience method for escaping special characters.
static String
quote(Object aValue)
Convenience method for adding quotes.
static String
unescape(String aValue)
Convenience method for replacing escaped special characters with their original form.
static String
unquote(String aValue)
Convenience method for removing surrounding quotes from a string value.
static String
valueOf(Object object)
Wraps java.lang.String.valueOf() to return an empty string where the specified object is null.

Field Details

LINE_SEPARATOR

public static final String LINE_SEPARATOR
A string used to denote the start (and end) of iCalendar content lines.

PARAM_QUOTE_PATTERN

public static final Pattern PARAM_QUOTE_PATTERN
Defines a regular expression representing all parameter strings that should be quoted.

Method Details

escape

public static String escape(String aValue)
Convenience method for escaping special characters.
Parameters:
aValue - a string value to escape
Returns:
an escaped representation of the specified string

quote

public static String quote(Object aValue)
Convenience method for adding quotes. The specified object is converted to a string representation by calling its toString() method.
Parameters:
aValue - an object to quote
Returns:
a quoted string

unescape

public static String unescape(String aValue)
Convenience method for replacing escaped special characters with their original form.
Parameters:
aValue - a string value to unescape
Returns:
a string representation of the specified string with escaped characters replaced with their original form

unquote

public static String unquote(String aValue)
Convenience method for removing surrounding quotes from a string value.
Parameters:
aValue - a string to remove quotes from
Returns:
an un-quoted string

valueOf

public static String valueOf(Object object)
Wraps java.lang.String.valueOf() to return an empty string where the specified object is null.
Parameters:
object -
Returns: