ERXValueUtilities Class Reference

List of all members.

Static Public Member Functions

static NSArray arrayValue (Object obj)
static NSArray arrayValueWithDefault (Object obj, NSArray def)
static BigDecimal bigDecimalValue (Object obj)
static BigDecimal bigDecimalValueWithDefault (Object obj, BigDecimal def)
static boolean booleanValue (Object obj)
static boolean booleanValueForBindingOnComponentWithDefault (String binding, WOComponent component, boolean def)
static Boolean BooleanValueWithDefault (Object obj, Boolean def)
static boolean booleanValueWithDefault (Object obj, boolean def)
static int compare (final int int1, final int int2)
static NSData dataValue (Object obj)
static NSData dataValueWithDefault (Object obj, NSData def)
static NSDictionary dictionaryValue (Object obj)
static NSDictionary dictionaryValueWithDefault (Object obj, NSDictionary def)
static double doubleValue (Object obj)
static Double DoubleValueWithDefault (Object obj, Double def)
static double doubleValueWithDefault (Object obj, double def)
static< TextendsEnum< T > T enumValue (Object obj, Class< T > enumType)
static< TextendsEnum< T > T enumValueWithDefault (Object obj, Class< T > enumType, T def)
static< TextendsEnum< T > T enumValueWithRequiredDefault (Object obj, T def)
static float floatValue (Object obj)
static Float FloatValueWithDefault (Object obj, Float def)
static float floatValueWithDefault (Object obj, float def)
static Integer IntegerValueWithDefault (Object obj, Integer def)
static int intValue (Object obj)
static int intValueWithDefault (Object obj, int def)
static boolean isNull (Object obj)
static long longValue (Object obj)
static Long LongValueWithDefault (Object obj, Long def)
static long longValueWithDefault (Object obj, long def)
static NSSet setValue (Object obj)
static NSSet setValueWithDefault (Object obj, NSSet def)


Detailed Description

ERXValueUtilities has useful conversion methods for reading and transforming boolean, int and floatvalues. Unless otherwise stated, when an empty string (or one containing only whitespace) is given, then the string is assumed to be null. This is because D2W is not able to give back null values anymore.
Author:
ak on Mon Oct 28 2002 ERExtensions

Member Function Documentation

static NSArray arrayValue ( Object  obj  )  [static]

Basic utility method for reading NSArray values which works also with Strings. The current implementation uses arrayValueWithDefault(Object, NSArray) with a default of null.

Parameters:
obj object to be evaluated
Returns:
NSArray evaluation of the given object

static NSArray arrayValueWithDefault ( Object  obj,
NSArray  def 
) [static]

Basic utility method for reading NSArray values which also works with serialized NSArrays and comma separated items. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
NSArray evaluation of the given object

static BigDecimal bigDecimalValue ( Object  obj  )  [static]

Basic utility method for reading BigDecimal values which works also with Strings. The current implementation uses bigDecimalValueWithDefault(Object, BigDecimal) with a default of null.

Parameters:
obj object to be evaluated
Returns:
BigDecimal evaluation of the given object

static BigDecimal bigDecimalValueWithDefault ( Object  obj,
BigDecimal  def 
) [static]

Basic utility method for reading BigDecimal values. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
BigDecimal evaluation of the given object

static boolean booleanValue ( Object  obj  )  [static]

Basic utility method for determining if an object represents either a true or false value. The current implementation tests if the object is an instance of a String or a Number. Numbers are false if they equal 0, Strings are false if they equal (case insensitive) 'no', 'false' or parse to 0.

Parameters:
obj object to be evaluated
Returns:
boolean evaluation of the given object

static boolean booleanValueForBindingOnComponentWithDefault ( String  binding,
WOComponent  component,
boolean  def 
) [static]

Parameters:
binding the binding to parse
component the component to evaluate the binding on
def the default value if the binding value is null
Returns:
the boolean value of the binding
Deprecated:
use ERXComponentUtilities.booleanValueForBinding(component, binding, def)

static Boolean BooleanValueWithDefault ( Object  obj,
Boolean  def 
) [static]

Basic utility method for determining if an object represents either a true or false value. The current implementation tests if the object is an instance of a String, or a Number. Numbers are false if they equal 0, Strings are false if they equal (case insensitive) 'no', 'false' or parse to 0. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
boolean evaluation of the given object

static boolean booleanValueWithDefault ( Object  obj,
boolean  def 
) [static]

Basic utility method for determining if an object represents either a true or false value. The current implementation tests if the object is an instance of a String, or a Number. Numbers are false if they equal 0, Strings are false if they equal (case insensitive) 'no', 'false' or parse to 0. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
boolean evaluation of the given object

static int compare ( final int  int1,
final int  int2 
) [static]

Returns the comparison value between int1 and int2 (using Comparator rules)

Parameters:
int1 value 1
int2 value 2
Returns:
the Comparator comparison between the two values

static NSData dataValue ( Object  obj  )  [static]

Basic utility method for reading NSData values which works also with Strings. The current implementation uses dataValueWithDefault(Object, NSData) with a default of null.

Parameters:
obj object to be evaluated
Returns:
NSData evaluation of the given object

static NSData dataValueWithDefault ( Object  obj,
NSData  def 
) [static]

Basic utility method for reading NSData values which also works with serialized NSData. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
NSData evaluation of the given object

static NSDictionary dictionaryValue ( Object  obj  )  [static]

Basic utility method for reading NSDictionary values which works also with Strings. The current implementation uses dictionaryValueWithDefault(Object, NSDictionary) with a default of null.

Parameters:
obj object to be evaluated
Returns:
NSDictionary evaluation of the given object

static NSDictionary dictionaryValueWithDefault ( Object  obj,
NSDictionary  def 
) [static]

Basic utility method for reading NSDictionary values which also works with serialized NSDictionarys. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
NSDictionary evaluation of the given object

static double doubleValue ( Object  obj  )  [static]

Basic utility method for reading double values. The current implementation uses doubleValueWithDefault(Object, double) with a default of 0.

Parameters:
obj object to be evaluated
Returns:
double evaluation of the given object

static Double DoubleValueWithDefault ( Object  obj,
Double  def 
) [static]

Basic utility method for reading Double values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
Double evaluation of the given object

static double doubleValueWithDefault ( Object  obj,
double  def 
) [static]

Basic utility method for reading double values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
double evaluation of the given object

static <TextendsEnum<T> T enumValue ( Object  obj,
Class< T >  enumType 
) [static]

Basic utility method for reading Enum values.

Parameters:
<T> Enum type evaluated
obj object to evaluate
enumType The desired enum class
Returns:
Enum evaluation of the given object or the default

static <TextendsEnum<T> T enumValueWithDefault ( Object  obj,
Class< T >  enumType,
def 
) [static]

Basic utility method for reading Enum values.

Parameters:
<T> Enum type evaluated
obj object to evaluate
enumType The desired enum class
def default value returned if obj is null.
Returns:
Enum evaluation of the given object or the default

static <TextendsEnum<T> T enumValueWithRequiredDefault ( Object  obj,
def 
) [static]

Basic utility method for reading Enum values.

Parameters:
obj object to be evaluated
def default value returned if object is null. If this value is null, the method throws a NullPointerException
<T> enum type evaluated
Returns:
Enum evaluation of the given object

static float floatValue ( Object  obj  )  [static]

Basic utility method for reading float values. The current implementation uses floatValueWithDefault(Object, float) with a default of 0.

Parameters:
obj object to be evaluated
Returns:
float evaluation of the given object

static Float FloatValueWithDefault ( Object  obj,
Float  def 
) [static]

Basic utility method for reading Float values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
Float evaluation of the given object

static float floatValueWithDefault ( Object  obj,
float  def 
) [static]

Basic utility method for reading float values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
float evaluation of the given object

static Integer IntegerValueWithDefault ( Object  obj,
Integer  def 
) [static]

Basic utility method for reading Integer values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
Integer evaluation of the given object

static int intValue ( Object  obj  )  [static]

Basic utility method for reading int values. The current implementation uses intValueWithDefault(Object, int) with a default of 0.

Parameters:
obj object to be evaluated
Returns:
integer evaluation of the given object

static int intValueWithDefault ( Object  obj,
int  def 
) [static]

Basic utility method for reading int values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
integer evaluation of the given object

static boolean isNull ( Object  obj  )  [static]

Returns whether or not the given object is null or NSKVC.Null.

Parameters:
obj the object to check
Returns:
true if the object is null or NSKVC.Null

static long longValue ( Object  obj  )  [static]

Basic utility method for reading long values. The current implementation uses longValueWithDefault(Object, long) with a default of 0.

Parameters:
obj object to be evaluated
Returns:
long evaluation of the given object

static Long LongValueWithDefault ( Object  obj,
Long  def 
) [static]

Basic utility method for reading Long values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
Long evaluation of the given object

static long longValueWithDefault ( Object  obj,
long  def 
) [static]

Basic utility method for reading long values. The current implementation tests if the object is an instance of a String, Number and Boolean. Booleans are 1 if they equal true. The default value is used if the object is null or the boolean value is false.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
long evaluation of the given object

static NSSet setValue ( Object  obj  )  [static]

Basic utility method for reading NSSet values which works also with Strings. The current implementation uses setValueWithDefault(Object, NSSet) with a default of null.

Parameters:
obj object to be evaluated
Returns:
NSSet evaluation of the given object

static NSSet setValueWithDefault ( Object  obj,
NSSet  def 
) [static]

Basic utility method for reading NSSet values which also works with serialized NSSets and comma separated items. The default value is used if the object is null.

Parameters:
obj object to be evaluated
def default value if object is null
Returns:
NSSet evaluation of the given object


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:15 2012 for Project Wonder by  doxygen 1.5.8