|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.binding.AbstractBinding
public abstract class 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 IBinding.getObject() 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 IBinding.setObject(Object) . |
void |
setDouble(double value)
Constructs an Double and invokes IBinding.setObject(Object) . |
void |
setInt(int value)
Constructs an Integer and invokes IBinding.setObject(Object) . |
void |
setObject(Object value)
Updates the value of the binding, if possible. |
void |
setString(String value)
Invokes IBinding.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
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
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
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
BindingException
- always.public void setInt(int value)
IBinding
Integer
and invokes IBinding.setObject(Object)
.
setInt
in interface IBinding
BindingException
- always.public void setDouble(double value)
IBinding
Double
and invokes IBinding.setObject(Object)
.
setDouble
in interface IBinding
BindingException
- always.public void setString(String value)
IBinding
IBinding.setObject(Object)
.
setString
in interface IBinding
BindingException
- always.public void setObject(Object value)
IBinding
setObject
in interface IBinding
BindingException
- always.public boolean isInvariant()
isInvariant
in interface IBinding
public Object getObject(String parameterName, Class type)
IBinding
getObject
in interface 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
classpublic boolean isWrapper(Class primitiveType, Class subjectClass)
protected BindingException createReadOnlyBindingException(IBinding binding)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |