ELResolver for Faces
.-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.faces.el.FacesCompositeELResolver
FacesCompositeELResolver.ELResolverChainType
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
_addPropertyELResolver
(ELResolver elResolver) void
add
(ELResolver elResolver) Adds the given resolver to the list of component resolvers.void
addPropertyELResolver
(ELResolver elResolver) void
addRootELResolver
(ELResolver elResolver) Class
<?> getCommonPropertyType
(ELContext context, Object base) Returns the most general type that this resolver accepts for theproperty
argument, given abase
object.Class
<?> For a givenbase
andproperty
, attempts to identify the most general type that is acceptable for an object to be passed as thevalue
parameter in a future call to theCompositeELResolver.setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
method.Attempts to resolve the givenproperty
object on the givenbase
object by querying all component resolvers.boolean
isReadOnly
(ELContext context, Object base, Object property) For a givenbase
andproperty
, attempts to determine whether a call toCompositeELResolver.setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
will always fail.void
Attempts to set the value of the givenproperty
object on the givenbase
object.Methods inherited from class jakarta.el.CompositeELResolver
convertToType, invoke
-
Constructor Details
-
DemuxCompositeELResolver
-
-
Method Details
-
getChainType
- Specified by:
getChainType
in classFacesCompositeELResolver
-
_addPropertyELResolver
-
addRootELResolver
- Specified by:
addRootELResolver
in classFacesCompositeELResolver
-
addPropertyELResolver
- Specified by:
addPropertyELResolver
in classFacesCompositeELResolver
-
add
Description copied from class:CompositeELResolver
Adds the given resolver to the list of component resolvers.Resolvers are consulted in the order in which they are added.
- Overrides:
add
in classCompositeELResolver
- Parameters:
elResolver
- The component resolver to add.
-
getValue
Description copied from class:CompositeELResolver
Attempts to resolve the givenproperty
object on the givenbase
object by querying all component resolvers.If this resolver handles the given (base, property) pair, the
propertyResolved
property of theELContext
object must be set totrue
by the resolver, before returning. If this property is nottrue
after this method is called, the caller should ignore the return value.First,
propertyResolved
is set tofalse
on the providedELContext
.Next, for each component resolver in this composite:
- The
getValue()
method is called, passing in the providedcontext
,base
andproperty
. - If the
ELContext
'spropertyResolved
flag isfalse
then iteration continues. - Otherwise, iteration stops and no more component resolvers are considered. The value returned by
getValue()
is returned by this method.
If none of the component resolvers were able to perform this operation, the value
null
is returned and thepropertyResolved
flag remains set tofalse
.Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.
- Overrides:
getValue
in classCompositeELResolver
- Parameters:
context
- The context of this evaluation.base
- The base object whose property value is to be returned, ornull
to resolve a top-level variable.property
- The property or variable to be resolved.- Returns:
- If the
propertyResolved
property ofELContext
was set totrue
, then the result of the variable or property resolution; otherwise undefined. - Throws:
ELException
- if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
- The
-
getType
Description copied from class:CompositeELResolver
For a givenbase
andproperty
, attempts to identify the most general type that is acceptable for an object to be passed as thevalue
parameter in a future call to theCompositeELResolver.setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
method. The result is obtained by querying all component resolvers.If this resolver handles the given (base, property) pair, the
propertyResolved
property of theELContext
object must be set totrue
by the resolver, before returning. If this property is nottrue
after this method is called, the caller should ignore the return value.First,
propertyResolved
is set tofalse
on the providedELContext
.Next, for each component resolver in this composite:
- The
getType()
method is called, passing in the providedcontext
,base
andproperty
. - If the
ELContext
'spropertyResolved
flag isfalse
then iteration continues. - Otherwise, iteration stops and no more component resolvers are considered. The value returned by
getType()
is returned by this method.
If none of the component resolvers were able to perform this operation, the value
null
is returned and thepropertyResolved
flag remains set tofalse
.Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.
- Overrides:
getType
in classCompositeELResolver
- Parameters:
context
- The context of this evaluation.base
- The base object whose property value is to be analyzed, ornull
to analyze a top-level variable.property
- The property or variable to return the acceptable type for.- Returns:
- If the
propertyResolved
property ofELContext
was set totrue
, then the most general acceptable type which must benull
if the either the property or the resolver is read-only; otherwise undefined - Throws:
ELException
- if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
- The
-
setValue
public void setValue(ELContext context, Object base, Object property, Object val) throws ELException Description copied from class:CompositeELResolver
Attempts to set the value of the givenproperty
object on the givenbase
object. All component resolvers are asked to attempt to set the value.If this resolver handles the given (base, property) pair, the
propertyResolved
property of theELContext
object must be set totrue
by the resolver, before returning. If this property is nottrue
after this method is called, the caller can safely assume no value has been set.First,
propertyResolved
is set tofalse
on the providedELContext
.Next, for each component resolver in this composite:
- The
setValue()
method is called, passing in the providedcontext
,base
,property
andvalue
. - If the
ELContext
'spropertyResolved
flag isfalse
then iteration continues. - Otherwise, iteration stops and no more component resolvers are considered.
If none of the component resolvers were able to perform this operation, the
propertyResolved
flag remains set tofalse
.Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.
- Overrides:
setValue
in classCompositeELResolver
- Parameters:
context
- The context of this evaluation.base
- The base object whose property value is to be set, ornull
to set a top-level variable.property
- The property or variable to be set.val
- The value to set the property or variable to.- Throws:
ELException
- if an exception was thrown while attempting to set the property or variable. The thrown exception must be included as the cause property of this exception, if available.
- The
-
isReadOnly
Description copied from class:CompositeELResolver
For a givenbase
andproperty
, attempts to determine whether a call toCompositeELResolver.setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)
will always fail. The result is obtained by querying all component resolvers.If this resolver handles the given (base, property) pair, the
propertyResolved
property of theELContext
object must be set totrue
by the resolver, before returning. If this property is nottrue
after this method is called, the caller should ignore the return value.First,
propertyResolved
is set tofalse
on the providedELContext
.Next, for each component resolver in this composite:
- The
isReadOnly()
method is called, passing in the providedcontext
,base
andproperty
. - If the
ELContext
'spropertyResolved
flag isfalse
then iteration continues. - Otherwise, iteration stops and no more component resolvers are considered. The value returned by
isReadOnly()
is returned by this method.
If none of the component resolvers were able to perform this operation, the value
.false
is returned and thepropertyResolved
flag remains set tofalse
Any exception thrown by component resolvers during the iteration is propagated to the caller of this method.
- Overrides:
isReadOnly
in classCompositeELResolver
- Parameters:
context
- The context of this evaluation.base
- The base object whose property value is to be analyzed, ornull
to analyze a top-level variable.property
- The property or variable to return the read-only status for.- Returns:
- If the
propertyResolved
property ofELContext
was set totrue
, thentrue
if the property is read-only orfalse
if not; otherwise undefined. - Throws:
ELException
- if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
- The
-
getCommonPropertyType
Description copied from class:CompositeELResolver
Returns the most general type that this resolver accepts for theproperty
argument, given abase
object. One use for this method is to assist tools in auto-completion. The result is obtained by querying all component resolvers.The
Class
returned is the most specific class that is a common superclass of all the classes returned by each component resolver'sgetCommonPropertyType
method. Ifnull
is returned by a resolver, it is skipped.- Overrides:
getCommonPropertyType
in classCompositeELResolver
- Parameters:
context
- The context of this evaluation.base
- The base object to return the most general property type for, ornull
to enumerate the set of top-level variables that this resolver can evaluate.- Returns:
null
if thisELResolver
does not know how to handle the givenbase
object; otherwiseObject.class
if any type ofproperty
is accepted; otherwise the most generalproperty
type accepted for the givenbase
.
-