Top Description Fields Constructors Methods
com.sun.faces.el

public Class ELUtils

extends Object
Class Inheritance
Static Imports
com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter.InterpretEmptyStringSubmittedValuesAsNull, com.sun.faces.util.MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, .MessageUtils.getExceptionMessageString, .Util.getCdiBeanManager, .Util.isEmpty, java.lang.Boolean.FALSE

Utility class for EL related methods.

Field Summary

Modifier and TypeField and Description
private static final Pattern
COMPOSITE_COMPONENT_EXPRESSION

Helps to determine if a EL expression represents a composite component EL expression.

private static final Matcher
private static final Pattern
COMPOSITE_COMPONENT_LOOKUP_WITH_ARGS

Used to determine if EL method arguments are being passed to a composite component lookup expression.

private static final LRUCache<String, Boolean>
compositeComponentEvaluationCache

Private cache for storing evaluation results for composite components checks.

private static final int
compositeComponentEvaluationCacheMaxSize

The maximum size of the compositeComponentEvaluationCache.

private static final Cache.Factory<String, Boolean>
isCompositeExpressionInit

Cache.Factory that initialize an element inside the LRUCache evaluating a Matcher against the input.

private static final Pattern
METHOD_EXPRESSION_LOOKUP

Use to determine if an expression being considered as a MethodExpression is a simple lookup (i.e. #{cc.attrs.myaction}).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
private static void
addELResolvers(CompositeELResolver
the CompositeELResolver to which the ELResolvers will be added.
target
,
List<ELResolver>
a List of ELResolvers
resolvers
)

Add the ELResolvers from the provided list to the target CompositeELResolver.

public static void
buildFacesResolver(FacesCompositeELResolver
a CompositeELResolver
composite
,
ApplicationAssociate
our ApplicationAssociate
associate
)

Create the ELResolver chain for programmatic EL calls.

private static void
public static Object
coerce(Object value, Class<?> toType)

public static ValueExpression

Returns:

a new ValueExpression instance based off the provided valueRef
createValueExpression
(String
an EL expression
expression
)

Create a ValueExpression with the expected type of Object.class

public static ValueExpression
createValueExpression(String expression, Class<?> expectedType)

public static Object
public static ExpressionFactory
public static ExpressionFactory
public static boolean
public static boolean
public static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COMPOSITE_COMPONENT_EXPRESSIONback to summary
private static final Pattern COMPOSITE_COMPONENT_EXPRESSION

Helps to determine if a EL expression represents a composite component EL expression.

COMPOSITE_COMPONENT_EXPRESSION_MATCHERback to summary
private static final Matcher COMPOSITE_COMPONENT_EXPRESSION_MATCHER
COMPOSITE_COMPONENT_LOOKUP_WITH_ARGSback to summary
private static final Pattern COMPOSITE_COMPONENT_LOOKUP_WITH_ARGS

Used to determine if EL method arguments are being passed to a composite component lookup expression. For example: #{cc.attrs.label('foo')} is illegal, while: #{cc.attrs.bean.label('foo')} is legal.

compositeComponentEvaluationCacheback to summary
private static final LRUCache<String, Boolean> compositeComponentEvaluationCache

Private cache for storing evaluation results for composite components checks.

compositeComponentEvaluationCacheMaxSizeback to summary
private static final int compositeComponentEvaluationCacheMaxSize

The maximum size of the compositeComponentEvaluationCache.

isCompositeExpressionInitback to summary
private static final Cache.Factory<String, Boolean> isCompositeExpressionInit

Cache.Factory that initialize an element inside the LRUCache evaluating a Matcher against the input. We should be able to share a Matcher because the Factory it's executed atomically and this Matcher is used only here

METHOD_EXPRESSION_LOOKUPback to summary
private static final Pattern METHOD_EXPRESSION_LOOKUP

Use to determine if an expression being considered as a MethodExpression is a simple lookup (i.e. #{cc.attrs.myaction}).

Constructor Detail

ELUtilsback to summary
private ELUtils()

Method Detail

addCDIELResolverback to summary
private static void addCDIELResolver(FacesCompositeELResolver composite)
addELResolversback to summary
private static void addELResolvers(CompositeELResolver target, List<ELResolver> resolvers)

Add the ELResolvers from the provided list to the target CompositeELResolver.

Parameters
target:CompositeELResolver

the CompositeELResolver to which the ELResolvers will be added.

resolvers:List<ELResolver>

a List of ELResolvers

buildFacesResolverback to summary
public static void buildFacesResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)

Create the ELResolver chain for programmatic EL calls.

Parameters
composite:FacesCompositeELResolver

a CompositeELResolver

associate:ApplicationAssociate

our ApplicationAssociate

checkNotNullback to summary
private static void checkNotNull(FacesCompositeELResolver composite, ApplicationAssociate associate)
coerceback to summary
public static Object coerce(Object value, Class<?> toType)
createValueExpressionback to summary
public static ValueExpression createValueExpression(String expression)

Create a ValueExpression with the expected type of Object.class

Parameters
expression:String

an EL expression

Returns:ValueExpression

a new ValueExpression instance based off the provided valueRef

createValueExpressionback to summary
public static ValueExpression createValueExpression(String expression, Class<?> expectedType)
evaluateValueExpressionback to summary
public static Object evaluateValueExpression(ValueExpression expression, ELContext elContext)
getDefaultExpressionFactoryback to summary
public static ExpressionFactory getDefaultExpressionFactory(FacesContext facesContext)
getDefaultExpressionFactoryback to summary
public static ExpressionFactory getDefaultExpressionFactory(ApplicationAssociate associate, FacesContext facesContext)
isCompositeComponentExprback to summary
public static boolean isCompositeComponentExpr(String expression)
isCompositeComponentLookupWithArgsback to summary
public static boolean isCompositeComponentLookupWithArgs(String expression)
isCompositeComponentMethodExprLookupback to summary
public static boolean isCompositeComponentMethodExprLookup(String expression)