com.primix.tapestry.binding
Class StaticBinding
java.lang.Object
|
+--com.primix.tapestry.binding.AbstractBinding
|
+--com.primix.tapestry.binding.StaticBinding
- All Implemented Interfaces:
- IBinding
- 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.11 2001/08/23 20:19:32 hship Exp $
- Author:
- Howard Ship
Method Summary |
double |
getDouble()
Interprets the static value as a double. |
int |
getInt()
Interprets the static value as an integer. |
java.lang.Object |
getObject()
Returns the value of the Binding. |
java.lang.String |
getString()
Gets the value for the binding. |
java.lang.Class |
getType()
Always returns String, even if the String has been
parsed as an integer or double. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StaticBinding
public StaticBinding(java.lang.String value)
getType
public java.lang.Class getType()
- Always returns String, even if the String has been
parsed as an integer or double.
- Since:
- 1.0.5
getInt
public int getInt()
- Interprets the static value as an integer.
- Overrides:
getInt
in class AbstractBinding
- Following copied from interface:
com.primix.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:
com.primix.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 java.lang.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 java.lang.Object getObject()
- Description copied from interface:
IBinding
- Returns the value of the Binding. This is the essential method. Other methods
get this value and cast or coerce the value.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object