com.sun.rave.web.ui.util
Class ValueTypeEvaluator

java.lang.Object
  extended by com.sun.rave.web.ui.util.ValueTypeEvaluator

public class ValueTypeEvaluator
extends java.lang.Object

The ValueTypeEvaluator and the ValueType (@see ValueType) classes are helper classes for UIComponents which accept value bindings that can be either single objects or a collection of objects (for example, an array). Typically, these components have to process input differently depending on the type of the value object.

Usage: create a ValueTypeEvaluator member class in the UIComponent's constructor. Invoke getValueType() to get the type of the component's value bindinding. ValueTypeEvaluator caches the value type after the first invocation, so the component should not cache the value itself.


Constructor Summary
ValueTypeEvaluator(javax.faces.component.UIComponent component)
          Creates a new instance of ValueTypeEvaluator.
 
Method Summary
 ValueType getValueType()
          Determine the type of the valuebinding of this object.
 ValueType getValueType(javax.faces.context.FacesContext context)
          Determine the type of the valuebinding of this object.
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueTypeEvaluator

public ValueTypeEvaluator(javax.faces.component.UIComponent component)
Creates a new instance of ValueTypeEvaluator.

Parameters:
component - The UIComponent for which the ValueTypeEvaluator is created
Method Detail

getValueType

public ValueType getValueType()
Determine the type of the valuebinding of this object. This method returns the cached ValueType if it has already been set. If it was not set, it retrieves the current FacesContext and invokes getValueType(FacesContext context).

Returns:
valueType the ValueType of this object

getValueType

public ValueType getValueType(javax.faces.context.FacesContext context)
Determine the type of the valuebinding of this object. This method returns the cached ValueType if it has already been set or otherwise determines the ValueType by evaluating the value binding for the component's value object.

Parameters:
context - The FacesContext
Returns:
valueType the ValueType of this object

reset

public void reset()