|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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()
ILocatablelocation from which
this object orginates, or null if not known.
getLocation in interface ILocatablepublic boolean getBoolean()
Tapestry.evaluateBoolean(Object).
getBoolean in interface IBindingTapestry.evaluateBoolean(Object)public int getInt()
IBindingIBinding.getObject() and coerces it
to an int. Strings will be parsed, and other
java.lang.Number classes will have intValue()
invoked.
getInt in interface IBindingpublic double getDouble()
IBindingIBinding.getObject() and coerces it
to a double. Strings will be parsed, and other
java.lang.Number classes will have doubleValue()
invoked.
getDouble in interface IBindingpublic String getString()
toString()) version of
the value.
getString in interface IBindingpublic void setBoolean(boolean value)
IBindingBoolean and invokes IBinding.setObject(Object).
setBoolean in interface IBindingBindingException - always.public void setInt(int value)
IBindingInteger and invokes IBinding.setObject(Object).
setInt in interface IBindingBindingException - always.public void setDouble(double value)
IBindingDouble and invokes IBinding.setObject(Object).
setDouble in interface IBindingBindingException - always.public void setString(String value)
IBindingIBinding.setObject(Object).
setString in interface IBindingBindingException - always.public void setObject(Object value)
IBinding
setObject in interface IBindingBindingException - always.public boolean isInvariant()
isInvariant in interface IBinding
public Object getObject(String parameterName,
Class type)
IBinding
getObject in interface IBindingparameterName - 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
class
public 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 | ||||||||