org.apache.tapestry.binding
Class StaticBinding

java.lang.Object
  extended by org.apache.tapestry.binding.AbstractBinding
      extended by 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 FieldBindings are cached.

Version:
$Id: StaticBinding.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
StaticBinding(String value, ILocation location)
           
 
Method Summary
 double getDouble()
          Interprets the static value as a double.
 int getInt()
          Interprets the static value as an integer.
 Object getObject()
          Returns the value of this binding.
 String getString()
          Gets the value for the binding.
 String toString()
           
 
Methods inherited from class org.apache.tapestry.binding.AbstractBinding
createReadOnlyBindingException, getBoolean, getLocation, getObject, isInvariant, isWrapper, setBoolean, setDouble, setInt, setObject, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StaticBinding

public StaticBinding(String value,
                     ILocation location)
Method Detail

getInt

public int getInt()
Interprets the static value as an integer.

Specified by:
getInt in interface IBinding
Overrides:
getInt in class AbstractBinding

getDouble

public double getDouble()
Interprets the static value as a double.

Specified by:
getDouble in interface IBinding
Overrides:
getDouble in class AbstractBinding

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.

Specified by:
getString in interface IBinding
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