|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tapestry.binding.AbstractBinding
Base class for IBinding
implementations.
Constructor Summary | |
protected |
AbstractBinding(ILocation location)
|
Method Summary | |
protected BindingException |
createReadOnlyBindingException(IBinding binding)
|
boolean |
getBoolean()
Cooerces the raw value into a true or false, according to the rules set by Tapestry.evaluateBoolean(Object) . |
double |
getDouble()
Gets the value of the Binding using IBinding.getObject() and coerces it
to a double . |
int |
getInt()
Gets the value of the Binding using getObject(java.lang.String, java.lang.Class) and coerces it
to an int . |
ILocation |
getLocation()
Returns the location from which
this object orginates, or null if not known. |
Object |
getObject(String parameterName,
Class type)
Returns the value for the binding after performing some basic checks. |
String |
getString()
Gets the value for the binding. |
boolean |
isInvariant()
Default implementation: returns true. |
boolean |
isWrapper(Class primitiveType,
Class subjectClass)
|
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(Object value)
Updates the value of the binding, if possible. |
void |
setString(String value)
Invokes setObject(Object) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.tapestry.IBinding |
getObject |
Constructor Detail |
protected AbstractBinding(ILocation location)
Method Detail |
public ILocation getLocation()
ILocatable
location
from which
this object orginates, or null if not known.getLocation
in interface ILocatable
public boolean getBoolean()
Tapestry.evaluateBoolean(Object)
.getBoolean
in interface IBinding
org.apache.tapestry.IBinding
Tapestry.evaluateBoolean(Object)
public int getInt()
IBinding
IBinding.getObject()
and coerces it
to an int
. Strings will be parsed, and other
java.lang.Number
classes will have intValue()
invoked.getInt
in interface IBinding
org.apache.tapestry.IBinding
ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.public double getDouble()
IBinding
IBinding.getObject()
and coerces it
to a double
. Strings will be parsed, and other
java.lang.Number
classes will have doubleValue()
invoked.getDouble
in interface IBinding
org.apache.tapestry.IBinding
ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.public String getString()
toString()
) version of
the value.getString
in interface IBinding
public void setBoolean(boolean value)
IBinding
Boolean
and invokes IBinding.setObject(Object)
.setBoolean
in interface IBinding
ReadOnlyBindingException
- always.public void setInt(int value)
IBinding
Integer
and invokes IBinding.setObject(Object)
.setInt
in interface IBinding
ReadOnlyBindingException
- always.public void setDouble(double value)
IBinding
Double
and invokes IBinding.setObject(Object)
.setDouble
in interface IBinding
ReadOnlyBindingException
- always.public void setString(String value)
IBinding
IBinding.setObject(Object)
.setString
in interface IBinding
ReadOnlyBindingException
- always.public void setObject(Object value)
IBinding
setObject
in interface IBinding
ReadOnlyBindingException
- always.public boolean isInvariant()
isInvariant
in interface IBinding
public Object getObject(String parameterName, Class type)
IBinding
getObject
in interface IBinding
org.apache.tapestry.IBinding
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 typepublic boolean isWrapper(Class primitiveType, Class subjectClass)
protected BindingException createReadOnlyBindingException(IBinding binding)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |