|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A binding is the mechanism used to provide values for parameters of
specific IComponent
instances. The component doesn't
care where the required value comes from, it simply requires that
a value be provided when needed.
Bindings are set inside the containing component's specification. Bindings may be static or dynamic (though that is irrelevant to the component). Components may also use a binding to write a value back through a property to some other object (typically, another component).
Method Summary | |
boolean |
getBoolean()
Invokes getObject() , then coerces the value to a boolean. |
double |
getDouble()
Gets the value of the Binding using getObject() and coerces it
to a double . |
int |
getInt()
Gets the value of the Binding using getObject() and coerces it
to an int . |
java.lang.Object |
getObject()
Returns the value of the Binding. |
java.lang.Object |
getObject(java.lang.String parameterName,
java.lang.Class type)
Returns the value for the binding after performing some basic checks. |
java.lang.String |
getString()
Invokes getObject() and converts the result to java.lang.String . |
java.lang.Class |
getType()
Returns the type of the binding. |
boolean |
isStatic()
Returns true if the value is statically defined. |
void |
setBoolean(boolean value)
Constructs a Boolean and invokes setObject(Object) . |
void |
setDouble(double value)
Constructs an Double and invokes setObject(Object) . |
void |
setInt(int value)
Constructs an Integer and invokes setObject(Object) . |
void |
setObject(java.lang.Object value)
Updates the value of the binding, if possible. |
void |
setString(java.lang.String value)
Invokes setObject(Object) . |
Method Detail |
public boolean getBoolean()
getObject()
, then coerces the value to a boolean.
The following rules are used to perform the coercion:
Boolean
value is self-evident
Number
value is true if non-zero
String
value is true if non-empty and contains
non-whitespace characters
Collection
value is true if it has a non-zero
size
public int getInt()
getObject()
and coerces it
to an int
. Strings will be parsed, and other
java.lang.Number
classes will have intValue()
invoked.ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.public double getDouble()
getObject()
and coerces it
to a double
. Strings will be parsed, and other
java.lang.Number
classes will have doubleValue()
invoked.ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.public java.lang.String getString()
getObject()
and converts the result to java.lang.String
.public java.lang.Object getObject()
public java.lang.Object getObject(java.lang.String parameterName, java.lang.Class type)
parameterName
- the name of the parameter (used to build
the message if an exception is thrown).type
- if not null, the value must be assignable to the specific
classBindingException
- if the value is not assignable to the
specified type
apublic boolean isStatic()
public void setBoolean(boolean value)
Boolean
and invokes setObject(Object)
.public void setInt(int value)
Integer
and invokes setObject(Object)
.public void setDouble(double value)
Double
and invokes setObject(Object)
.public void setString(java.lang.String value)
setObject(Object)
.public void setObject(java.lang.Object value)
ReadOnlyBindingException
- If the binding is read only.public java.lang.Class getType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |