org.apache.tapestry.binding
Class StaticBinding
java.lang.Object
|
+--org.apache.tapestry.binding.AbstractBinding
|
+--org.apache.tapestry.binding.StaticBinding
- All Implemented Interfaces:
- IBinding, ILocatable
- public class StaticBinding
- extends AbstractBinding
Stores a static (invariant) String as the value.
It may be useful to cache static bindings the way FieldBinding
s are cached.
- Version:
- $Id: StaticBinding.java,v 1.3 2003/04/21 13:15:30 glongman Exp $
- Author:
- Howard Lewis Ship
Methods inherited from class org.apache.tapestry.binding.AbstractBinding |
createReadOnlyBindingException, getBoolean, getLocation, getObject, isInvariant, isWrapper, setBoolean, setDouble, setInt, setObject, setString |
StaticBinding
public StaticBinding(String value,
ILocation location)
getInt
public int getInt()
- Interprets the static value as an integer.
- Overrides:
getInt
in class AbstractBinding
- Following copied from interface:
org.apache.tapestry.IBinding
- Throws:
ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.
getDouble
public double getDouble()
- Interprets the static value as a double.
- Overrides:
getDouble
in class AbstractBinding
- Following copied from interface:
org.apache.tapestry.IBinding
- Throws:
ClassCastException
- if the binding's value is not of a usable class.NullValueForBindingException
- if the binding's value is null.
getString
public String getString()
- Description copied from class:
AbstractBinding
- Gets the value for the binding. If null, returns null,
otherwise, returns the String (
toString()
) version of
the value.
- Overrides:
getString
in class AbstractBinding
getObject
public Object getObject()
- Description copied from interface:
IBinding
- Returns the value of this binding. This is the essential method. Other methods
get this value and cast or coerce the value.
toString
public String toString()
- Overrides:
toString
in class Object