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

public final Class EvaluationContext

extends ELContext
Class Inheritance
Imports
java.util.List, .Map, javax.el.ELContext, .ELResolver, .EvaluationListener, .FunctionMapper, .ImportHandler, .VariableMapper

The context for Jakarta Expression expression evaluation. This wrapper ELContext captures the function mapper and the variable mapper at the point when the expression is parsed, and only for those functions and variable used in the expression.

Field Summary

Modifier and TypeField and Description
private final ELContext
private final FunctionMapper
private final VariableMapper

Constructor Summary

AccessConstructor and Description
public
EvaluationContext(ELContext elContext, FunctionMapper fnMapper, VariableMapper varMapper)

Method Summary

Modifier and TypeMethod and Description
public void
addEvaluationListener(EvaluationListener
The listener to be added.
listener
)

Overrides javax.el.ELContext.addEvaluationListener.

Registers an evaluation listener to the ELContext.
public Object
convertToType(Object
The object to convert.
obj
,
Class<?>
The target type for the conversion.
targetType
)

Overrides javax.el.ELContext.convertToType.

Converts an object to a specific type.
public void
enterLambdaScope(Map<String, Object>
The Lambda arguments map
args
)

Overrides javax.el.ELContext.enterLambdaScope.

Installs a Lambda argument map, in preparation for the evaluation of a Lambda expression.
public void
exitLambdaScope()

Overrides javax.el.ELContext.exitLambdaScope.

Exits the Lambda expression evaluation.
public Object
getContext(Class<T>
The unique identifier that was used to associate the context object with this ELContext.
key
)

Overrides javax.el.ELContext.getContext.

Returns the context object associated with the given key.
public ELContext
public ELResolver
getELResolver()

Implements abstract javax.el.ELContext.getELResolver.

Retrieves the ELResolver associated with this context.
public List<EvaluationListener>
getEvaluationListeners()

Overrides javax.el.ELContext.getEvaluationListeners.

Returns the list of registered evaluation listeners.
public FunctionMapper
getFunctionMapper()

Implements abstract javax.el.ELContext.getFunctionMapper.

Retrieves the FunctionMapper associated with this ELContext.
public ImportHandler
getImportHandler()

Overrides javax.el.ELContext.getImportHandler.

Retrieves the ImportHandler associated with this ELContext.
public Object
getLambdaArgument(String
The formal parameter for the Lambda argument
arg
)

Overrides javax.el.ELContext.getLambdaArgument.

Retrieves the Lambda argument associated with a formal parameter.
public VariableMapper
getVariableMapper()

Implements abstract javax.el.ELContext.getVariableMapper.

Retrieves the VariableMapper associated with this ELContext.
public boolean
isLambdaArgument(String
A possible Lambda formal parameter name
arg
)

Overrides javax.el.ELContext.isLambdaArgument.

Inquires if the name is a LambdaArgument
public boolean
isPropertyResolved()

Overrides javax.el.ELContext.isPropertyResolved.

Returns whether an ELResolver has successfully resolved a given (base, property) pair.
public void
notifyAfterEvaluation(String
The EL expression string that has been evaluated
expr
)

Overrides javax.el.ELContext.notifyAfterEvaluation.

Notifies the listeners after an EL expression is evaluated
public void
notifyBeforeEvaluation(String
The EL expression string to be evaluated
expr
)

Overrides javax.el.ELContext.notifyBeforeEvaluation.

Notifies the listeners before an EL expression is evaluated
public void
notifyPropertyResolved(Object
The base object
base
,
Object
The property Object
property
)

Overrides javax.el.ELContext.notifyPropertyResolved.

Notifies the listeners when the (base, property) pair is resolved
public void
putContext(Class<T>
The key used by an @{link ELResolver} to identify this context object.
key
,
Object
The context object to add to the collection.
contextObject
)

Overrides javax.el.ELContext.putContext.

Associates a context object with this ELContext.
public void
setPropertyResolved(boolean
true if the property has been resolved, or false if not.
resolved
)

Overrides javax.el.ELContext.setPropertyResolved.

Called to indicate that a ELResolver has successfully resolved a given (base, property) pair.
public void
setPropertyResolved(Object
The base object
base
,
Object
The property object
property
)

Overrides javax.el.ELContext.setPropertyResolved.

Called to indicate that a ELResolver has successfully resolved a given (base, property) pair and to notify the EvaluationListeners.
Inherited from javax.el.ELContext:
getLocalesetLocale

Field Detail

elContextback to summary
private final ELContext elContext
fnMapperback to summary
private final FunctionMapper fnMapper
varMapperback to summary
private final VariableMapper varMapper

Constructor Detail

EvaluationContextback to summary
public EvaluationContext(ELContext elContext, FunctionMapper fnMapper, VariableMapper varMapper)

Method Detail

addEvaluationListenerback to summary
public void addEvaluationListener(EvaluationListener listener)

Overrides javax.el.ELContext.addEvaluationListener.

Doc from javax.el.ELContext.addEvaluationListener.

Registers an evaluation listener to the ELContext.

Parameters
listener:EvaluationListener

The listener to be added.

Annotations
@Override
convertToTypeback to summary
public Object convertToType(Object obj, Class<?> targetType)

Overrides javax.el.ELContext.convertToType.

Doc from javax.el.ELContext.convertToType.

Converts an object to a specific type. If a custom converter in the ELResolver handles this conversion, it is used. Otherwise the standard coercions is applied.

An ELException is thrown if an error occurs during the conversion.

Parameters
obj:Object

The object to convert.

targetType:Class<?>

The target type for the conversion.

Annotations
@Override
enterLambdaScopeback to summary
public void enterLambdaScope(Map<String, Object> args)

Overrides javax.el.ELContext.enterLambdaScope.

Doc from javax.el.ELContext.enterLambdaScope.

Installs a Lambda argument map, in preparation for the evaluation of a Lambda expression. The arguments in the map will be in scope during the evaluation of the Lambda expression.

Parameters
args:Map<String, Object>

The Lambda arguments map

Annotations
@Override
exitLambdaScopeback to summary
public void exitLambdaScope()

Overrides javax.el.ELContext.exitLambdaScope.

Doc from javax.el.ELContext.exitLambdaScope.

Exits the Lambda expression evaluation. The Lambda argument map that was previously installed is removed.

Annotations
@Override
getContextback to summary
public Object getContext(Class<T> key)

Overrides javax.el.ELContext.getContext.

Doc from javax.el.ELContext.getContext.

Returns the context object associated with the given key.

The ELContext maintains a collection of context objects relevant to the evaluation of an expression. These context objects are used by ELResolvers. This method is used to retrieve the context with the given key from the collection.

By convention, the object returned will be of the type specified by the key. However, this is not required and the key is used strictly as a unique identifier.

Parameters
key:Class<T>

The unique identifier that was used to associate the context object with this ELContext.

Returns:Object

The context object associated with the given key, or null if no such context was found.

Annotations
@Override
getELContextback to summary
public ELContext getELContext()
getELResolverback to summary
public ELResolver getELResolver()

Implements abstract javax.el.ELContext.getELResolver.

Doc from javax.el.ELContext.getELResolver.

Retrieves the ELResolver associated with this context.

The ELContext maintains a reference to the ELResolver that will be consulted to resolve variables and properties during an expression evaluation. This method retrieves the reference to the resolver.

Once an ELContext is constructed, the reference to the ELResolver associated with the context cannot be changed.

Returns:ELResolver

The resolver to be consulted for variable and property resolution during expression evaluation.

Annotations
@Override
getEvaluationListenersback to summary
public List<EvaluationListener> getEvaluationListeners()

Overrides javax.el.ELContext.getEvaluationListeners.

Doc from javax.el.ELContext.getEvaluationListeners.

Returns the list of registered evaluation listeners.

Returns:List<EvaluationListener>

The list of registered evaluation listeners.

Annotations
@Override
getFunctionMapperback to summary
public FunctionMapper getFunctionMapper()

Implements abstract javax.el.ELContext.getFunctionMapper.

Doc from javax.el.ELContext.getFunctionMapper.

Retrieves the FunctionMapper associated with this ELContext.

Returns:FunctionMapper

The function mapper to be consulted for the resolution of EL functions.

Annotations
@Override
getImportHandlerback to summary
public ImportHandler getImportHandler()

Overrides javax.el.ELContext.getImportHandler.

Doc from javax.el.ELContext.getImportHandler.

Retrieves the ImportHandler associated with this ELContext.

Returns:ImportHandler

The import handler to manage imports of classes and packages.

Annotations
@Override
getLambdaArgumentback to summary
public Object getLambdaArgument(String arg)

Overrides javax.el.ELContext.getLambdaArgument.

Doc from javax.el.ELContext.getLambdaArgument.

Retrieves the Lambda argument associated with a formal parameter. If the Lambda expression is nested within other Lambda expressions, the arguments for the current Lambda expression is first searched, and if not found, the arguments for the immediate nesting Lambda expression then searched, and so on.

Parameters
arg:String

The formal parameter for the Lambda argument

Returns:Object

The object associated with formal parameter. Null if no object has been associated with the parameter.

Annotations
@Override
getVariableMapperback to summary
public VariableMapper getVariableMapper()

Implements abstract javax.el.ELContext.getVariableMapper.

Doc from javax.el.ELContext.getVariableMapper.

Retrieves the VariableMapper associated with this ELContext.

Returns:VariableMapper

The variable mapper to be consulted for the resolution of EL variables.

Annotations
@Override
isLambdaArgumentback to summary
public boolean isLambdaArgument(String arg)

Overrides javax.el.ELContext.isLambdaArgument.

Doc from javax.el.ELContext.isLambdaArgument.

Inquires if the name is a LambdaArgument

Parameters
arg:String

A possible Lambda formal parameter name

Returns:boolean

true if arg is a LambdaArgument, false otherwise.

Annotations
@Override
isPropertyResolvedback to summary
public boolean isPropertyResolved()

Overrides javax.el.ELContext.isPropertyResolved.

Doc from javax.el.ELContext.isPropertyResolved.

Returns whether an ELResolver has successfully resolved a given (base, property) pair.

The CompositeELResolver checks this property to determine whether it should consider or skip other component resolvers.

Returns:boolean

true if the property has been resolved, or false if not.

Annotations
@Override
notifyAfterEvaluationback to summary
public void notifyAfterEvaluation(String expr)

Overrides javax.el.ELContext.notifyAfterEvaluation.

Doc from javax.el.ELContext.notifyAfterEvaluation.

Notifies the listeners after an EL expression is evaluated

Parameters
expr:String

The EL expression string that has been evaluated

Annotations
@Override
notifyBeforeEvaluationback to summary
public void notifyBeforeEvaluation(String expr)

Overrides javax.el.ELContext.notifyBeforeEvaluation.

Doc from javax.el.ELContext.notifyBeforeEvaluation.

Notifies the listeners before an EL expression is evaluated

Parameters
expr:String

The EL expression string to be evaluated

Annotations
@Override
notifyPropertyResolvedback to summary
public void notifyPropertyResolved(Object base, Object property)

Overrides javax.el.ELContext.notifyPropertyResolved.

Doc from javax.el.ELContext.notifyPropertyResolved.

Notifies the listeners when the (base, property) pair is resolved

Parameters
base:Object

The base object

property:Object

The property Object

Annotations
@Override
putContextback to summary
public void putContext(Class<T> key, Object contextObject)

Overrides javax.el.ELContext.putContext.

Doc from javax.el.ELContext.putContext.

Associates a context object with this ELContext.

The ELContext maintains a collection of context objects relevant to the evaluation of an expression. These context objects are used by ELResolvers. This method is used to add a context object to that collection.

By convention, the contextObject will be of the type specified by the key. However, this is not required and the key is used strictly as a unique identifier.

Parameters
key:Class<T>

The key used by an @{link ELResolver} to identify this context object.

contextObject:Object

The context object to add to the collection.

Annotations
@Override
setPropertyResolvedback to summary
public void setPropertyResolved(boolean resolved)

Overrides javax.el.ELContext.setPropertyResolved.

Doc from javax.el.ELContext.setPropertyResolved.

Called to indicate that a ELResolver has successfully resolved a given (base, property) pair. Use setPropertyResolved(Object, Object) if resolved is true and to notify EvaluationListeners.

The CompositeELResolver checks this property to determine whether it should consider or skip other component resolvers.

Parameters
resolved:boolean

true if the property has been resolved, or false if not.

Annotations
@Override
setPropertyResolvedback to summary
public void setPropertyResolved(Object base, Object property)

Overrides javax.el.ELContext.setPropertyResolved.

Doc from javax.el.ELContext.setPropertyResolved.

Called to indicate that a ELResolver has successfully resolved a given (base, property) pair and to notify the EvaluationListeners.

The CompositeELResolver checks this property to determine whether it should consider or skip other component resolvers.

Parameters
base:Object

The base object

property:Object

The property object

Annotations
@Override