|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object er.extensions.ERXValueUtilities
ERXValueUtilities has usefull conversion methods for
reading and transforming boolean
,
int
and float
values.
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.
Constructor Summary | |
ERXValueUtilities()
|
Method Summary | |
static NSArray |
arrayValue(Object obj)
Basic utility method for reading NSArray values which works also with Strings. |
static NSArray |
arrayValueWithDefault(Object obj,
NSArray def)
Basic utility method for reading NSArray values
which also works with serialzed NSArrays. |
static BigDecimal |
bigDecimalValue(Object obj)
Basic utility method for reading BigDecimal values which works also with Strings. |
static BigDecimal |
bigDecimalValueWithDefault(Object obj,
BigDecimal def)
Basic utility method for reading BigDecimal values.
|
static boolean |
booleanValue(Object obj)
Basic utility method for determining if an object represents either a true or false value. |
static boolean |
booleanValueForBindingOnComponentWithDefault(String binding,
WOComponent component,
boolean def)
This method resolves bindings from WOComponents to boolean values. |
static boolean |
booleanValueWithDefault(Object obj,
boolean def)
Basic utility method for determining if an object represents either a true or false value. |
static NSDictionary |
dictionaryValue(Object obj)
Basic utility method for reading NSDictionary values which works also with Strings. |
static NSDictionary |
dictionaryValueWithDefault(Object obj,
NSDictionary def)
Basic utility method for reading NSDictionary values
which also works with serialzed NSDictionarys. |
static int |
intValue(Object obj)
Basic utility method for reading int values. |
static int |
intValueForBindingOnComponentWithDefault(String binding,
WOComponent component,
int def)
This method resolves bindings from WOComponents to int values.
|
static int |
intValueWithDefault(Object obj,
int def)
Basic utility method for reading int values. |
static long |
longValue(Object obj)
Basic utility method for reading long values. |
static long |
longValueForBindingOnComponentWithDefault(String binding,
WOComponent component,
long def)
This method resolves bindings from WOComponents to long values.
|
static long |
longValueWithDefault(Object obj,
long def)
Basic utility method for reading long values. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ERXValueUtilities()
Method Detail |
public static boolean booleanValueForBindingOnComponentWithDefault(String binding, WOComponent component, boolean def)
false
is
bound to a binding will pass through null. This makes
it difficult to handle the case where a binding should
default to true but false was actually bound to the
binding.
binding
- name of the bindingcomponent
- to resolve binding requestdef
- default value if binding is not set
public static boolean booleanValue(Object obj)
0
, Strings are false if they equal (case insensitive)
'no', 'false' or parse to 0.
obj
- object to be evaluated
public static boolean booleanValueWithDefault(Object obj, boolean def)
String
, a Number
or a
ERXUtilities.BooleanOperation
.
Numbers are false if they equal 0
,
Strings are false if they equal (case insensitive)
'no', 'false' or parse to 0.
ERXUtilities.BooleanOperation
are false if value
returns false
.
The default value is used if the object is null.
obj
- object to be evaluateddef
- default value if object is null
public static int intValueForBindingOnComponentWithDefault(String binding, WOComponent component, int def)
int
values.
Note: This is only needed for non-syncronizing components
binding
- name of the bindingcomponent
- to resolve binding requestdef
- default value if binding is not set
public static int intValue(Object obj)
intValueWithDefault(Object, int)
with a default of 0
.
obj
- object to be evaluated
public static int intValueWithDefault(Object obj, int def)
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.
obj
- object to be evaluateddef
- default value if object is null
public static long longValueForBindingOnComponentWithDefault(String binding, WOComponent component, long def)
long
values.
Note: This is only needed for non-syncronizing components
binding
- name of the bindingcomponent
- to resolve binding requestdef
- default value if binding is not set
public static long longValue(Object obj)
longValueWithDefault(Object, long)
with a default of 0
.
obj
- object to be evaluated
public static long longValueWithDefault(Object obj, long def)
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.
obj
- object to be evaluateddef
- default value if object is null
public static NSArray arrayValue(Object obj)
arrayValueWithDefault(Object, NSArray)
with a default of null
.
obj
- object to be evaluated
public static NSArray arrayValueWithDefault(Object obj, NSArray def)
NSArray
values
which also works with serialzed NSArrays. The default value is used if
the object is null.
obj
- object to be evaluateddef
- default value if object is null
public static NSDictionary dictionaryValue(Object obj)
dictionaryValueWithDefault(Object, NSDictionary)
with a default of null
.
obj
- object to be evaluated
public static NSDictionary dictionaryValueWithDefault(Object obj, NSDictionary def)
NSDictionary
values
which also works with serialzed NSDictionarys. The default value is used if
the object is null.
obj
- object to be evaluateddef
- default value if object is null
public static BigDecimal bigDecimalValue(Object obj)
bigDecimalValueWithDefault(Object, BigDecimal)
with a default of null
.
obj
- object to be evaluated
public static BigDecimal bigDecimalValueWithDefault(Object obj, BigDecimal def)
BigDecimal
values.
The default value is used if the object is null.
obj
- object to be evaluateddef
- default value if object is null
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |