A utility class to convert the configuration properties into any type.
author: Emmanuel Bourg version: $Revision: 490321 $, $Date: 2006-12-26 17:19:07 +0100 (Di, 26 Dez 2006) $ since: 1.1
Escapes the delimiters that might be contained in the given string. This
method ensures that list delimiter characters that are part of a
property's value are correctly escaped when a configuration is saved to a
file. Otherwise when loaded again the property will be treated as a list
property.
Parameters: s - the string with the value Parameters: delimiter - the list delimiter to use the correctly esaped string
Performs interpolation of the specified value. This method checks if the
given value contains variables of the form ${...}. If
this is the case, all occurrances will be substituted by their current
values.
Parameters: value - the value to be interpolated Parameters: config - the current configuration object the interpolated value
Split a string on the specified delimiter. To be removed when
commons-lang has a better replacement available (Tokenizer?).
todo: replace with a commons-lang equivalent
Parameters: s - the string to split Parameters: delimiter - the delimiter a list with the single tokens
Convert the specified object into a BigDecimal.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a BigDecimal
Convert the specified object into a BigInteger.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a BigInteger
Convert the specified object into a Boolean. Internally the
org.apache.commons.lang.BooleanUtils class from the
Commons Lang
project is used to perform this conversion. This class accepts some more
tokens for the boolean value of true, e.g. yes and
on. Please refer to the documentation of this class for more
details.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a boolean
Convert the specified object into a Byte.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a byte
Convert the specified object into a Calendar.
Parameters: value - the value to convert Parameters: format - the DateFormat pattern to parse String values the converted value throws: ConversionException - thrown if the value cannot be converted to a Calendar
Convert the specified object into a Date.
Parameters: value - the value to convert Parameters: format - the DateFormat pattern to parse String values the converted value throws: ConversionException - thrown if the value cannot be converted to a Calendar
Convert the specified object into a Double.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a Double
Convert the specified object into a Float.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a Float
Convert the specified object into an Integer.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to an integer
Convert the specified object into a Locale.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a Locale
Convert the specified object into a Long.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a Long
Tries to convert the specified object into a number object. This method
is used by the conversion methods for number types. Note that the return
value is not in always of the specified target class, but only if a new
object has to be created.
Parameters: value - the value to be converted (must not be null) Parameters: targetClass - the target class of the conversion (must be derivedfrom java.lang.Number) the converted number throws: ConversionException - if the object cannot be converted
Convert the specified object into a Short.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to a short
Convert the specified object into an URL.
Parameters: value - the value to convert the converted value throws: ConversionException - thrown if the value cannot be converted to an URL