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

public Class ELUtils

extends Object
Class Inheritance
Static Imports
com.sun.faces.RIConstants.EMPTY_CLASS_ARGS, com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter.InterpretEmptyStringSubmittedValuesAsNull, com.sun.faces.util.MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, .MessageUtils.getExceptionMessageString, .ReflectionUtils.lookupMethod, .ReflectionUtils.newInstance, .Util.getCdiBeanManager

Utility class for EL related methods.

Field Summary

Modifier and TypeField and Description
public static final ArrayELResolver
public static final BeanELResolver
public static final ResourceBundleELResolver
public static final CompositeComponentAttributesELResolver
private static final Pattern
COMPOSITE_COMPONENT_EXPRESSION

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

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 HashMap<String, Boolean>
compositeComponentEvaluationCache

Private cache for storing evaluation results for composite components checks.

private static final int
compositeComponentEvaluationCacheMaxSize

The maximum size of the compositeComponentEvaluationCache.

public static final EmptyStringToNullELResolver
private static final LinkedList<String>
evaluationCacheFifoQueue

FIFO queue, holding access information about the compositeComponentEvaluationCache.

public static final FacesResourceBundleELResolver
public static final FlashELResolver
private static final Boolean
IS_COMPOSITE_COMPONENT

Class member, indicating a positive evaluation result.

private static final Boolean
IS_NOT_A_COMPOSITE_COMPONENT

Class member, indicating a negative evaluation result.

public static final ListELResolver
public static final MapELResolver
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}).

public static final ResourceELResolver
public static final ScopedAttributeELResolver

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
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
private static void
rememberEvaluationResult(String expression, boolean isCompositeComponent)

Adds the specified expression with its evaluation result isCompositeComponent to the compositeComponentEvaluationCache, taking into account the maximum cache size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ARRAY_RESOLVERback to summary
public static final ArrayELResolver ARRAY_RESOLVER
BEAN_RESOLVERback to summary
public static final BeanELResolver BEAN_RESOLVER
BUNDLE_RESOLVERback to summary
public static final ResourceBundleELResolver BUNDLE_RESOLVER
COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVERback to summary
public static final CompositeComponentAttributesELResolver COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVER
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_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 HashMap<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.

EMPTY_STRING_TO_NULL_RESOLVERback to summary
public static final EmptyStringToNullELResolver EMPTY_STRING_TO_NULL_RESOLVER
evaluationCacheFifoQueueback to summary
private static final LinkedList<String> evaluationCacheFifoQueue

FIFO queue, holding access information about the compositeComponentEvaluationCache.

FACES_BUNDLE_RESOLVERback to summary
public static final FacesResourceBundleELResolver FACES_BUNDLE_RESOLVER
FLASH_RESOLVERback to summary
public static final FlashELResolver FLASH_RESOLVER
IS_COMPOSITE_COMPONENTback to summary
private static final Boolean IS_COMPOSITE_COMPONENT

Class member, indicating a positive evaluation result.

IS_NOT_A_COMPOSITE_COMPONENTback to summary
private static final Boolean IS_NOT_A_COMPOSITE_COMPONENT

Class member, indicating a negative evaluation result.

LIST_RESOLVERback to summary
public static final ListELResolver LIST_RESOLVER
MAP_RESOLVERback to summary
public static final MapELResolver MAP_RESOLVER
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}).

RESOURCE_RESOLVERback to summary
public static final ResourceELResolver RESOURCE_RESOLVER
SCOPED_RESOLVERback to summary
public static final ScopedAttributeELResolver SCOPED_RESOLVER

Constructor Detail

ELUtilsback to summary
private ELUtils()

Method Detail

addCDIELResolverback to summary
private static void addCDIELResolver(FacesCompositeELResolver composite)
addEL3_0_Resolversback to summary
private static void addEL3_0_Resolvers(FacesCompositeELResolver composite, ApplicationAssociate associate)
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)
rememberEvaluationResultback to summary
private static void rememberEvaluationResult(String expression, boolean isCompositeComponent)

Adds the specified expression with its evaluation result isCompositeComponent to the compositeComponentEvaluationCache, taking into account the maximum cache size.