org.apache.tapestry.bean
Class Default
java.lang.Object
|
+--org.apache.tapestry.bean.Default
- All Implemented Interfaces:
- IPoolable
- public class Default
- extends Object
- implements IPoolable
A helper bean to assist with providing defaults for unspecified
parameters. It is initalized
with an IBinding
and a default value. It's value property
is either the value of the binding, but if the binding is null,
or the binding returns null, the default value is returned.
- Since:
- 1.0.5
- Version:
- $Id: Default.java,v 1.2 2003/04/17 21:33:54 hlship Exp $
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Default
public Default()
resetForPool
public void resetForPool()
- Description copied from interface:
IPoolable
- Invoked by a
Pool
just before the object is added to the pool.
The object should return its state to how it was when freshly instantiated
(or at least, its state should be indistinguishable from a freshly
instantiated instance).
- Specified by:
resetForPool
in interface IPoolable
setBinding
public void setBinding(IBinding value)
getBinding
public IBinding getBinding()
setDefaultValue
public void setDefaultValue(Object value)
getDefaultValue
public Object getDefaultValue()
getValue
public Object getValue()
- Returns the value of the binding. However, if the binding is null, or the binding
returns null, then the defaultValue is returned instead.
discardFromPool
public void discardFromPool()
- Description copied from interface:
IPoolable
- Invoked just as a Pool discards an object (for lack of use).
This allows a last chance to perform final cleanup
on the object while it is still referencable.
- Specified by:
discardFromPool
in interface IPoolable
- Since:
- 3.0