- java.lang.Object
-
- javax.el.ELContext
-
- javax.el.StandardELContext
-
public class StandardELContext extends ELContext
A standard ELContext suitable for use in a stand alone environment. This class provides a default implementation of an ELResolver that contains a number of useful ELResolvers. It also provides local repositories for the FunctionMapper, VariableMapper, and BeanNameResolver.- Since:
- EL 3.0
-
-
Constructor Summary
Constructors Constructor and Description StandardELContext(ELContext context)
Construct a StandardELContext from another ELContext.StandardELContext(ExpressionFactory factory)
Construct a default ELContext for a stand-alone environment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
addELResolver(ELResolver cELResolver)
Add a custom ELResolver to the context.Object
getContext(Class key)
Returns the context object associated with the given key.ELResolver
getELResolver()
Construct (if needed) and return a default ELResolver.FunctionMapper
getFunctionMapper()
Construct (if needed) and return a default FunctionMapper.VariableMapper
getVariableMapper()
Construct (if needed) and return a default VariableMapper() {void
putContext(Class key, Object contextObject)
Associates a context object with thisELContext
.-
Methods inherited from class javax.el.ELContext
addEvaluationListener, convertToType, enterLambdaScope, exitLambdaScope, getEvaluationListeners, getImportHandler, getLambdaArgument, getLocale, isLambdaArgument, isPropertyResolved, notifyAfterEvaluation, notifyBeforeEvaluation, notifyPropertyResolved, setLocale, setPropertyResolved, setPropertyResolved
-
-
-
-
Constructor Detail
-
StandardELContext
public StandardELContext(ExpressionFactory factory)
Construct a default ELContext for a stand-alone environment.- Parameters:
factory
- The ExpressionFactory
-
StandardELContext
public StandardELContext(ELContext context)
Construct a StandardELContext from another ELContext.- Parameters:
context
- The ELContext that acts as a delegate in most cases
-
-
Method Detail
-
putContext
public void putContext(Class key, Object contextObject)
Description copied from class:ELContext
Associates a context object with thisELContext
.The
ELContext
maintains a collection of context objects relevant to the evaluation of an expression. These context objects are used byELResolver
s. This method is used to add a context object to that collection.By convention, the
contextObject
will be of the type specified by thekey
. However, this is not required and the key is used strictly as a unique identifier.- Overrides:
putContext
in classELContext
- Parameters:
key
- The key used by an @{link ELResolver} to identify this context object.contextObject
- The context object to add to the collection.
-
getContext
public Object getContext(Class key)
Description copied from class:ELContext
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 byELResolver
s. 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.- Overrides:
getContext
in classELContext
- Parameters:
key
- The unique identifier that was used to associate the context object with thisELContext
.- Returns:
- The context object associated with the given key, or null if no such context was found.
-
getELResolver
public ELResolver getELResolver()
Construct (if needed) and return a default ELResolver.Retrieves the
ELResolver
associated with this context. This is aCompositeELResover
consists of an ordered list ofELResolver
s.- A
BeanNameELResolver
for beans defined locally - Any custom
ELResolver
s - An
ELResolver
supporting the collection operations - A
StaticFieldELResolver
for resolving static fields - A
MapELResolver
for resolving Map properties - A
ResourceBundleELResolver
for resolving ResourceBundle properties - A
ListELResolver
for resolving List properties - An
ArrayELResolver
for resolving array properties - A
BeanELResolver
for resolving bean properties
- Specified by:
getELResolver
in classELContext
- Returns:
- The ELResolver for this context.
- A
-
addELResolver
public void addELResolver(ELResolver cELResolver)
Add a custom ELResolver to the context. The list of the custom ELResolvers will be accessed in the order they are added. A custom ELResolver added to the context cannot be removed.- Parameters:
cELResolver
- The new ELResolver to be added to the context
-
getFunctionMapper
public FunctionMapper getFunctionMapper()
Construct (if needed) and return a default FunctionMapper.- Specified by:
getFunctionMapper
in classELContext
- Returns:
- The default FunctionMapper
-
getVariableMapper
public VariableMapper getVariableMapper()
Construct (if needed) and return a default VariableMapper() {- Specified by:
getVariableMapper
in classELContext
- Returns:
- The default Variable
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/el/StandardELContext.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.