org.apache.myfaces.extensions.validator.core.el
Class DefaultELHelper

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.el.DefaultELHelper
All Implemented Interfaces:
ELHelper

public class DefaultELHelper
extends Object
implements ELHelper

in order to centralize the jsf version dependency within the core this el-helper supports jsp and facelets (tested with 1.1.14)

Since:
1.x.1

Field Summary
protected  Logger logger
           
protected  boolean projectStageDevelopment
           
 
Constructor Summary
DefaultELHelper()
           
 
Method Summary
 Object getBean(String beanName)
          Resolves the bean instance for the specified name.
 Object getBindingOfComponent(javax.faces.component.UIComponent uiComponent, String name)
          Gets the value of the attribute specified by the parameter name for the UIComponent.
 PropertyDetails getPropertyDetailsOfValueBinding(javax.faces.component.UIComponent uiComponent)
          Extracts the property details (expression, base object and property name) information of the value attribute of the given UIComponent value attribute.
protected  PropertyDetails getPropertyDetailsViaReflectionFallback(javax.faces.component.UIComponent uiComponent)
           
 Class getTypeOfExpression(javax.faces.context.FacesContext facesContext, ValueBindingExpression valueBindingExpression)
          Evaluates the type returned by ELHelper.getValueOfExpression(javax.faces.context.FacesContext, org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression)
 Object getValueOfExpression(javax.faces.context.FacesContext facesContext, ValueBindingExpression valueBindingExpression)
          Evaluates the given expression within the current FacesContext
 boolean isELTermValid(javax.faces.context.FacesContext facesContext, String valueBindingExpression)
          Determines if the expression is a valid expression, meaning that the expression can be evaluated without an exception.
 boolean isELTermWellFormed(Object o)
          A very basic check of the EL expression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger

projectStageDevelopment

protected final boolean projectStageDevelopment
Constructor Detail

DefaultELHelper

public DefaultELHelper()
Method Detail

getTypeOfExpression

public Class getTypeOfExpression(javax.faces.context.FacesContext facesContext,
                                 ValueBindingExpression valueBindingExpression)
Description copied from interface: ELHelper
Evaluates the type returned by ELHelper.getValueOfExpression(javax.faces.context.FacesContext, org.apache.myfaces.extensions.validator.core.el.ValueBindingExpression)

Specified by:
getTypeOfExpression in interface ELHelper
Parameters:
facesContext - FacesContext for the current request
valueBindingExpression - value-binding to evaluate
Returns:
type of the result of the expression

getBean

public Object getBean(String beanName)
Description copied from interface: ELHelper
Resolves the bean instance for the specified name.

Specified by:
getBean in interface ELHelper
Parameters:
beanName - The bean name we are interested in, no EL expression.
Returns:
instance for the bean name or null.

getValueOfExpression

public Object getValueOfExpression(javax.faces.context.FacesContext facesContext,
                                   ValueBindingExpression valueBindingExpression)
Description copied from interface: ELHelper
Evaluates the given expression within the current FacesContext

Specified by:
getValueOfExpression in interface ELHelper
Parameters:
facesContext - FacesContext for the current request
valueBindingExpression - value-binding to evaluate
Returns:
result for the given expression

isELTermValid

public boolean isELTermValid(javax.faces.context.FacesContext facesContext,
                             String valueBindingExpression)
Description copied from interface: ELHelper
Determines if the expression is a valid expression, meaning that the expression can be evaluated without an exception.

Specified by:
isELTermValid in interface ELHelper
Parameters:
facesContext - The JSF Context
valueBindingExpression - The EL expression we want to evaluate.
Returns:
true if the expression is valid - false otherwise

getPropertyDetailsOfValueBinding

public PropertyDetails getPropertyDetailsOfValueBinding(javax.faces.component.UIComponent uiComponent)
Description copied from interface: ELHelper
Extracts the property details (expression, base object and property name) information of the value attribute of the given UIComponent value attribute.

Specified by:
getPropertyDetailsOfValueBinding in interface ELHelper
Parameters:
uiComponent - The UIComponent in question
Returns:
property details for the value of the given UIComponent

getPropertyDetailsViaReflectionFallback

protected PropertyDetails getPropertyDetailsViaReflectionFallback(javax.faces.component.UIComponent uiComponent)

isELTermWellFormed

public boolean isELTermWellFormed(Object o)
Description copied from interface: ELHelper
A very basic check of the EL expression

Specified by:
isELTermWellFormed in interface ELHelper
Parameters:
o - Object in question
Returns:
true if the given object is a well formed string - false otherwise

getBindingOfComponent

public Object getBindingOfComponent(javax.faces.component.UIComponent uiComponent,
                                    String name)
Description copied from interface: ELHelper
Gets the value of the attribute specified by the parameter name for the UIComponent.

Specified by:
getBindingOfComponent in interface ELHelper
Parameters:
uiComponent - The UIComponent in question
name - The name of the attribute.
Returns:
The ValueExpression assigned to the attribute.


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.