Package com.sun.faces.el
Class ELUtils
java.lang.Object
com.sun.faces.el.ELUtils
public class ELUtils extends Object
Utility class for EL related methods.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classELUtils.Scope -
Field Summary
Fields Modifier and Type Field Description static jakarta.el.ArrayELResolverARRAY_RESOLVERstatic jakarta.el.BeanELResolverBEAN_RESOLVERstatic jakarta.el.ResourceBundleELResolverBUNDLE_RESOLVERstatic CompositeComponentAttributesELResolverCOMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVERstatic FacesResourceBundleELResolverFACES_BUNDLE_RESOLVERstatic FlashELResolverFLASH_RESOLVERstatic ImplicitObjectELResolverForJspIMPLICIT_JSP_RESOLVERstatic ImplicitObjectELResolverIMPLICIT_RESOLVERstatic jakarta.el.ListELResolverLIST_RESOLVERstatic ManagedBeanELResolverMANAGED_BEAN_RESOLVERstatic jakarta.el.MapELResolverMAP_RESOLVERstatic ResourceELResolverRESOURCE_RESOLVERstatic ScopedAttributeELResolverSCOPED_RESOLVER -
Method Summary
Modifier and Type Method Description static voidbuildFacesResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)Create theELResolverchain for programmatic EL calls.static voidbuildJSPResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)Create theELResolverchain for JSP.static Objectcoerce(Object value, Class<?> toType)static jakarta.el.ValueExpressioncreateValueExpression(String expression)Create aValueExpressionwith the expected type ofObject.classstatic jakarta.el.ValueExpressioncreateValueExpression(String expression, Class<?> expectedType)static ObjectevaluateValueExpression(jakarta.el.ValueExpression expression, jakarta.el.ELContext elContext)static jakarta.el.ExpressionFactorygetDefaultExpressionFactory(ApplicationAssociate associate, FacesContext facesContext)static jakarta.el.ExpressionFactorygetDefaultExpressionFactory(FacesContext facesContext)static PropertyResolvergetDelegatePR(ApplicationAssociate associate, boolean provideDefault)static VariableResolvergetDelegateVR(ApplicationAssociate associate, boolean provideDefault)static List<String>getExpressionsFromString(String expressionString)static ELUtils.ScopegetNarrowestScopeFromExpression(String expression)static ELUtils.ScopegetScope(String scope)static ELUtils.ScopegetScope(String valueBinding, String[] outString)This method is used by the ManagedBeanFactory to ensure that properties set by an expression point to an object with an accepted lifespan.static ELUtils.ScopegetScopeForExpression(String expression)static ELUtils.ScopegetScopeForSingleExpression(String value)static booleanhasValidLifespan(ELUtils.Scope expressionScope, ELUtils.Scope beanScope)static booleanisCompositeComponentExpr(String expression)static booleanisCompositeComponentLookupWithArgs(String expression)static booleanisCompositeComponentMethodExprLookup(String expression)static booleanisScopeValid(String scopeName)
-
Field Details
-
ARRAY_RESOLVER
public static final jakarta.el.ArrayELResolver ARRAY_RESOLVER -
BEAN_RESOLVER
public static final jakarta.el.BeanELResolver BEAN_RESOLVER -
FACES_BUNDLE_RESOLVER
-
IMPLICIT_JSP_RESOLVER
-
IMPLICIT_RESOLVER
-
FLASH_RESOLVER
-
LIST_RESOLVER
public static final jakarta.el.ListELResolver LIST_RESOLVER -
MANAGED_BEAN_RESOLVER
-
MAP_RESOLVER
public static final jakarta.el.MapELResolver MAP_RESOLVER -
BUNDLE_RESOLVER
public static final jakarta.el.ResourceBundleELResolver BUNDLE_RESOLVER -
SCOPED_RESOLVER
-
RESOURCE_RESOLVER
-
COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVER
public static final CompositeComponentAttributesELResolver COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVER
-
-
Method Details
-
isCompositeComponentExpr
-
isCompositeComponentMethodExprLookup
-
isCompositeComponentLookupWithArgs
-
buildFacesResolver
public static void buildFacesResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)Create the
ELResolverchain for programmatic EL calls.- Parameters:
composite- aCompositeELResolverassociate- our ApplicationAssociate
-
buildJSPResolver
public static void buildJSPResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)Create the
ELResolverchain for JSP.- Parameters:
composite- aCompositeELResolverassociate- our ApplicationAssociate
-
evaluateValueExpression
public static Object evaluateValueExpression(jakarta.el.ValueExpression expression, jakarta.el.ELContext elContext) -
getDelegatePR
public static PropertyResolver getDelegatePR(ApplicationAssociate associate, boolean provideDefault)- Parameters:
associate- theApplicationAssociateprovideDefault- whether or not to return aDummpyPropertyResolverImpl- Returns:
- the
PropertyResolvers set viaApplication.setPropertyResolver(jakarta.faces.el.PropertyResolver)or, if that isnull, return thePropertyResolverchain from the parsed configuration resources. If either of those are null, andprovideDefaultistrue, return theDummyPropertyResolverImpl.
-
getDelegateVR
public static VariableResolver getDelegateVR(ApplicationAssociate associate, boolean provideDefault)- Parameters:
associate- theApplicationAssociateprovideDefault- whether or not to return aDummpyPropertyResolverImpl- Returns:
- the
VariableResolvers set viaApplication.setVariableResolver(jakarta.faces.el.VariableResolver)or, if that isnull, return theVariableResolverchain from the parsed configuration resources. If either of those are null, , andprovideDefaultistrue, return theChainAwareVariableResolver.
-
getExpressionsFromString
public static List<String> getExpressionsFromString(String expressionString) throws ReferenceSyntaxException- Parameters:
expressionString- the expression string, with delimiters intact.- Returns:
- a List of expressions from the expressionString
- Throws:
ReferenceSyntaxException- if the expression string is invalid
-
getScope
public static ELUtils.Scope getScope(String valueBinding, String[] outString) throws ReferenceSyntaxExceptionThis method is used by the ManagedBeanFactory to ensure that properties set by an expression point to an object with an accepted lifespan.
get the scope of the expression. Return
nullif it isn't scopedFor example, the expression:
sessionScope.TestBean.oneshould return "session" as the scope.- Parameters:
valueBinding- the expressionoutString- an allocated String Array into which we put the first segment.- Returns:
- the scope of the expression
- Throws:
ReferenceSyntaxException- if valueBinding is syntactically invalid
-
createValueExpression
Create aValueExpressionwith the expected type ofObject.class- Parameters:
expression- an EL expression- Returns:
- a new
ValueExpressioninstance based off the providedvalueRef
-
createValueExpression
-
coerce
-
getScope
-
getScopeForExpression
-
hasValidLifespan
public static boolean hasValidLifespan(ELUtils.Scope expressionScope, ELUtils.Scope beanScope) throws EvaluationException- Throws:
EvaluationException
-
getScopeForSingleExpression
- Throws:
EvaluationException
-
getNarrowestScopeFromExpression
public static ELUtils.Scope getNarrowestScopeFromExpression(String expression) throws ReferenceSyntaxException- Throws:
ReferenceSyntaxException
-
isScopeValid
-
getDefaultExpressionFactory
-
getDefaultExpressionFactory
public static jakarta.el.ExpressionFactory getDefaultExpressionFactory(ApplicationAssociate associate, FacesContext facesContext)
-