org.apache.tapestry.param
Class AbstractParameterConnector
java.lang.Object
|
+--org.apache.tapestry.param.AbstractParameterConnector
- All Implemented Interfaces:
- IParameterConnector
- Direct Known Subclasses:
- BooleanParameterConnector, DoubleParameterConnector, IntParameterConnector, ObjectParameterConnector, StringParameterConnector
- public abstract class AbstractParameterConnector
- extends Object
- implements IParameterConnector
Standard implementation of IParameterConnector
.
Subclasses add in the ability to clear parameters.
- Since:
- 2.0.3
- Version:
- $Id: AbstractParameterConnector.java,v 1.4 2003/05/16 18:54:23 hlship Exp $
- Author:
- Howard Lewis Ship
AbstractParameterConnector
protected AbstractParameterConnector(IComponent component,
String parameterName,
IBinding binding)
- Creates a connector. In addition, obtains the current value
of the component property; this value will be used to
restore the component property.
setPropertyValue
protected void setPropertyValue(Object value)
- Sets the property of the component to the specified value.
getBindingValue
protected Object getBindingValue(Class requiredType)
- Gets the value of the binding.
- Parameters:
requiredType
- if not null, the expected type of the value object.- See Also:
IBinding.getObject()
,
IBinding.getObject(String, Class)
getBinding
protected IBinding getBinding()
toString
public String toString()
- Overrides:
toString
in class Object
resetParameter
public void resetParameter(IRequestCycle cycle)
- Restores the property to its default value. For
Direction.FORM
parameters, extracts the
property value and sets the binding form it
(when appropriate).
- Specified by:
resetParameter
in interface IParameterConnector
shouldSetPropertyValue
protected boolean shouldSetPropertyValue(IRequestCycle cycle)
- Returns true if the connector should update the property value from
the binding. For
Direction.IN
, this
always returns true. For Direction.FORM
,
this returns true only if the request cycle and the active form
are rewinding.
- Since:
- 2.2