Package org.apache.el.lang
Class EvaluationContext
- java.lang.Object
-
- javax.el.ELContext
-
- org.apache.el.lang.EvaluationContext
-
public final class EvaluationContext extends ELContext
-
-
Constructor Summary
Constructors Constructor Description EvaluationContext(ELContext elContext, FunctionMapper fnMapper, VariableMapper varMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvaluationListener(EvaluationListener listener)Register an EvaluationListener with this ELContext.java.lang.ObjectconvertToType(java.lang.Object obj, java.lang.Class<?> type)Coerce the supplied object to the requested type.voidenterLambdaScope(java.util.Map<java.lang.String,java.lang.Object> arguments)Called when starting to evaluate a lambda expression so that the arguments are available to the EL context during evaluation.voidexitLambdaScope()Called after evaluating a lambda expression to signal that the arguments are no longer required.java.lang.ObjectgetContext(java.lang.Class key)Obtain the context object for the given key.ELContextgetELContext()ELResolvergetELResolver()java.util.List<EvaluationListener>getEvaluationListeners()Obtain the list of registered EvaluationListeners.FunctionMappergetFunctionMapper()ImportHandlergetImportHandler()Obtain the ImportHandler for this ELContext, creating one if necessary.java.lang.ObjectgetLambdaArgument(java.lang.String name)Obtain the value of the lambda argument with the given name.LambdaExpressionNestedStategetLambdaExpressionNestedState()java.util.LocalegetLocale()VariableMappergetVariableMapper()booleanisLambdaArgument(java.lang.String name)Determine if the specified name is recognised as the name of a lambda argument.booleanisPropertyResolved()voidnotifyAfterEvaluation(java.lang.String expression)Notify interested listeners that an expression has been evaluated.voidnotifyBeforeEvaluation(java.lang.String expression)Notify interested listeners that an expression will be evaluated.voidnotifyPropertyResolved(java.lang.Object base, java.lang.Object property)Notify interested listeners that a property has been resolved.voidputContext(java.lang.Class key, java.lang.Object contextObject)Add an object to this EL context under the given key.voidsetLambdaExpressionNestedState(LambdaExpressionNestedState lambdaExpressionNestedState)voidsetLocale(java.util.Locale locale)voidsetPropertyResolved(boolean resolved)voidsetPropertyResolved(java.lang.Object base, java.lang.Object property)Mark the given property as resolved and notify any interested listeners.
-
-
-
Constructor Detail
-
EvaluationContext
public EvaluationContext(ELContext elContext, FunctionMapper fnMapper, VariableMapper varMapper)
-
-
Method Detail
-
getELContext
public ELContext getELContext()
-
getFunctionMapper
public FunctionMapper getFunctionMapper()
- Specified by:
getFunctionMapperin classELContext
-
getVariableMapper
public VariableMapper getVariableMapper()
- Specified by:
getVariableMapperin classELContext
-
getContext
public java.lang.Object getContext(java.lang.Class key)
Description copied from class:javax.el.ELContextObtain the context object for the given key.- Overrides:
getContextin classELContext- Parameters:
key- The key of the required context object- Returns:
- The value of the context object associated with the given key
-
getELResolver
public ELResolver getELResolver()
- Specified by:
getELResolverin classELContext
-
isPropertyResolved
public boolean isPropertyResolved()
- Overrides:
isPropertyResolvedin classELContext
-
putContext
public void putContext(java.lang.Class key, java.lang.Object contextObject)Description copied from class:javax.el.ELContextAdd an object to this EL context under the given key.- Overrides:
putContextin classELContext- Parameters:
key- The key under which to store the objectcontextObject- The object to add
-
setPropertyResolved
public void setPropertyResolved(boolean resolved)
- Overrides:
setPropertyResolvedin classELContext
-
setPropertyResolved
public void setPropertyResolved(java.lang.Object base, java.lang.Object property)Description copied from class:javax.el.ELContextMark the given property as resolved and notify any interested listeners.- Overrides:
setPropertyResolvedin classELContext- Parameters:
base- The base object on which the property was foundproperty- The property that was resolved
-
getImportHandler
public ImportHandler getImportHandler()
Description copied from class:javax.el.ELContextObtain the ImportHandler for this ELContext, creating one if necessary. This method is not thread-safe.- Overrides:
getImportHandlerin classELContext- Returns:
- the ImportHandler for this ELContext.
-
addEvaluationListener
public void addEvaluationListener(EvaluationListener listener)
Description copied from class:javax.el.ELContextRegister an EvaluationListener with this ELContext.- Overrides:
addEvaluationListenerin classELContext- Parameters:
listener- The EvaluationListener to register
-
getEvaluationListeners
public java.util.List<EvaluationListener> getEvaluationListeners()
Description copied from class:javax.el.ELContextObtain the list of registered EvaluationListeners.- Overrides:
getEvaluationListenersin classELContext- Returns:
- A list of the EvaluationListener registered with this ELContext
-
notifyBeforeEvaluation
public void notifyBeforeEvaluation(java.lang.String expression)
Description copied from class:javax.el.ELContextNotify interested listeners that an expression will be evaluated.- Overrides:
notifyBeforeEvaluationin classELContext- Parameters:
expression- The expression that will be evaluated
-
notifyAfterEvaluation
public void notifyAfterEvaluation(java.lang.String expression)
Description copied from class:javax.el.ELContextNotify interested listeners that an expression has been evaluated.- Overrides:
notifyAfterEvaluationin classELContext- Parameters:
expression- The expression that was evaluated
-
notifyPropertyResolved
public void notifyPropertyResolved(java.lang.Object base, java.lang.Object property)Description copied from class:javax.el.ELContextNotify interested listeners that a property has been resolved.- Overrides:
notifyPropertyResolvedin classELContext- Parameters:
base- The object on which the property was resolvedproperty- The property that was resolved
-
isLambdaArgument
public boolean isLambdaArgument(java.lang.String name)
Description copied from class:javax.el.ELContextDetermine if the specified name is recognised as the name of a lambda argument.- Overrides:
isLambdaArgumentin classELContext- Parameters:
name- The name of the lambda argument- Returns:
trueif the name is recognised as the name of a lambda argument, otherwisefalse
-
getLambdaArgument
public java.lang.Object getLambdaArgument(java.lang.String name)
Description copied from class:javax.el.ELContextObtain the value of the lambda argument with the given name.- Overrides:
getLambdaArgumentin classELContext- Parameters:
name- The name of the lambda argument- Returns:
- The value of the specified argument
-
enterLambdaScope
public void enterLambdaScope(java.util.Map<java.lang.String,java.lang.Object> arguments)
Description copied from class:javax.el.ELContextCalled when starting to evaluate a lambda expression so that the arguments are available to the EL context during evaluation.- Overrides:
enterLambdaScopein classELContext- Parameters:
arguments- The arguments in scope for the current lambda expression.
-
exitLambdaScope
public void exitLambdaScope()
Description copied from class:javax.el.ELContextCalled after evaluating a lambda expression to signal that the arguments are no longer required.- Overrides:
exitLambdaScopein classELContext
-
convertToType
public java.lang.Object convertToType(java.lang.Object obj, java.lang.Class<?> type)Description copied from class:javax.el.ELContextCoerce the supplied object to the requested type.- Overrides:
convertToTypein classELContext- Parameters:
obj- The object to be coercedtype- The type to which the object should be coerced- Returns:
- An instance of the requested type.
-
getLambdaExpressionNestedState
public LambdaExpressionNestedState getLambdaExpressionNestedState()
-
setLambdaExpressionNestedState
public void setLambdaExpressionNestedState(LambdaExpressionNestedState lambdaExpressionNestedState)
-
-