public class ELUtils extends Object
Utility class for EL related methods.
| Modifier and Type | Class and Description |
|---|---|
static class |
ELUtils.Scope |
| Modifier and Type | Field and Description |
|---|---|
static jakarta.el.ArrayELResolver |
ARRAY_RESOLVER |
static jakarta.el.BeanELResolver |
BEAN_RESOLVER |
static jakarta.el.ResourceBundleELResolver |
BUNDLE_RESOLVER |
static CompositeComponentAttributesELResolver |
COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVER |
static FacesResourceBundleELResolver |
FACES_BUNDLE_RESOLVER |
static FlashELResolver |
FLASH_RESOLVER |
static ImplicitObjectELResolverForJsp |
IMPLICIT_JSP_RESOLVER |
static ImplicitObjectELResolver |
IMPLICIT_RESOLVER |
static jakarta.el.ListELResolver |
LIST_RESOLVER |
static ManagedBeanELResolver |
MANAGED_BEAN_RESOLVER |
static jakarta.el.MapELResolver |
MAP_RESOLVER |
static ResourceELResolver |
RESOURCE_RESOLVER |
static ScopedAttributeELResolver |
SCOPED_RESOLVER |
| Modifier and Type | Method and Description |
|---|---|
static void |
buildFacesResolver(FacesCompositeELResolver composite,
ApplicationAssociate associate)
Create the
ELResolver chain for programmatic EL calls. |
static void |
buildJSPResolver(FacesCompositeELResolver composite,
ApplicationAssociate associate)
Create the
ELResolver chain for JSP. |
static Object |
coerce(Object value,
Class<?> toType) |
static jakarta.el.ValueExpression |
createValueExpression(String expression)
Create a
ValueExpression with the expected type of Object.class |
static jakarta.el.ValueExpression |
createValueExpression(String expression,
Class<?> expectedType) |
static Object |
evaluateValueExpression(jakarta.el.ValueExpression expression,
jakarta.el.ELContext elContext) |
static jakarta.el.ExpressionFactory |
getDefaultExpressionFactory(ApplicationAssociate associate,
jakarta.faces.context.FacesContext facesContext) |
static jakarta.el.ExpressionFactory |
getDefaultExpressionFactory(jakarta.faces.context.FacesContext facesContext) |
static jakarta.faces.el.PropertyResolver |
getDelegatePR(ApplicationAssociate associate,
boolean provideDefault) |
static jakarta.faces.el.VariableResolver |
getDelegateVR(ApplicationAssociate associate,
boolean provideDefault) |
static List<String> |
getExpressionsFromString(String expressionString) |
static ELUtils.Scope |
getNarrowestScopeFromExpression(String expression) |
static ELUtils.Scope |
getScope(String scope) |
static ELUtils.Scope |
getScope(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.Scope |
getScopeForExpression(String expression) |
static ELUtils.Scope |
getScopeForSingleExpression(String value) |
static boolean |
hasValidLifespan(ELUtils.Scope expressionScope,
ELUtils.Scope beanScope) |
static boolean |
isCompositeComponentExpr(String expression) |
static boolean |
isCompositeComponentLookupWithArgs(String expression) |
static boolean |
isCompositeComponentMethodExprLookup(String expression) |
static boolean |
isScopeValid(String scopeName) |
public static final jakarta.el.ArrayELResolver ARRAY_RESOLVER
public static final jakarta.el.BeanELResolver BEAN_RESOLVER
public static final FacesResourceBundleELResolver FACES_BUNDLE_RESOLVER
public static final ImplicitObjectELResolverForJsp IMPLICIT_JSP_RESOLVER
public static final ImplicitObjectELResolver IMPLICIT_RESOLVER
public static final FlashELResolver FLASH_RESOLVER
public static final jakarta.el.ListELResolver LIST_RESOLVER
public static final ManagedBeanELResolver MANAGED_BEAN_RESOLVER
public static final jakarta.el.MapELResolver MAP_RESOLVER
public static final jakarta.el.ResourceBundleELResolver BUNDLE_RESOLVER
public static final ScopedAttributeELResolver SCOPED_RESOLVER
public static final ResourceELResolver RESOURCE_RESOLVER
public static final CompositeComponentAttributesELResolver COMPOSITE_COMPONENT_ATTRIBUTES_EL_RESOLVER
public static boolean isCompositeComponentExpr(String expression)
public static boolean isCompositeComponentMethodExprLookup(String expression)
public static boolean isCompositeComponentLookupWithArgs(String expression)
public static void buildFacesResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)
Create the ELResolver chain for programmatic EL calls.
composite - a CompositeELResolverassociate - our ApplicationAssociatepublic static void buildJSPResolver(FacesCompositeELResolver composite, ApplicationAssociate associate)
Create the ELResolver chain for JSP.
composite - a CompositeELResolverassociate - our ApplicationAssociatepublic static Object evaluateValueExpression(jakarta.el.ValueExpression expression, jakarta.el.ELContext elContext)
public static jakarta.faces.el.PropertyResolver getDelegatePR(ApplicationAssociate associate, boolean provideDefault)
associate - the ApplicationAssociateprovideDefault - whether or not to return a DummpyPropertyResolverImplPropertyResolvers set via
Application.setPropertyResolver(jakarta.faces.el.PropertyResolver) or, if that is
null, return the PropertyResolver chain from the parsed configuration resources. If either
of those are null, and provideDefault is true, return the
DummyPropertyResolverImpl.public static jakarta.faces.el.VariableResolver getDelegateVR(ApplicationAssociate associate, boolean provideDefault)
associate - the ApplicationAssociateprovideDefault - whether or not to return a DummpyPropertyResolverImplVariableResolvers set via
Application.setVariableResolver(jakarta.faces.el.VariableResolver) or, if that is
null, return the VariableResolver chain from the parsed configuration resources. If either
of those are null, , and provideDefault is true, return the
ChainAwareVariableResolver.public static List<String> getExpressionsFromString(String expressionString) throws jakarta.faces.el.ReferenceSyntaxException
expressionString - the expression string, with delimiters intact.jakarta.faces.el.ReferenceSyntaxException - if the expression string is invalidpublic static ELUtils.Scope getScope(String valueBinding, String[] outString) throws jakarta.faces.el.ReferenceSyntaxException
This 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 null if it isn't scoped
For example, the expression: sessionScope.TestBean.one should return "session" as the scope.
valueBinding - the expressionoutString - an allocated String Array into which we put the first segment.jakarta.faces.el.ReferenceSyntaxException - if valueBinding is syntactically invalidpublic static jakarta.el.ValueExpression createValueExpression(String expression)
ValueExpression with the expected type of Object.classexpression - an EL expressionValueExpression instance based off the provided valueRefpublic static jakarta.el.ValueExpression createValueExpression(String expression, Class<?> expectedType)
public static ELUtils.Scope getScope(String scope)
public static ELUtils.Scope getScopeForExpression(String expression)
public static boolean hasValidLifespan(ELUtils.Scope expressionScope, ELUtils.Scope beanScope) throws jakarta.faces.el.EvaluationException
jakarta.faces.el.EvaluationExceptionpublic static ELUtils.Scope getScopeForSingleExpression(String value) throws jakarta.faces.el.EvaluationException
jakarta.faces.el.EvaluationExceptionpublic static ELUtils.Scope getNarrowestScopeFromExpression(String expression) throws jakarta.faces.el.ReferenceSyntaxException
jakarta.faces.el.ReferenceSyntaxExceptionpublic static boolean isScopeValid(String scopeName)
public static jakarta.el.ExpressionFactory getDefaultExpressionFactory(jakarta.faces.context.FacesContext facesContext)
public static jakarta.el.ExpressionFactory getDefaultExpressionFactory(ApplicationAssociate associate, jakarta.faces.context.FacesContext facesContext)
Copyright © 2010–2022 JBoss by Red Hat. All rights reserved.