- java.lang.Object
-
- javax.el.BeanNameResolver
-
public abstract class BeanNameResolver extends Object
Resolves a bean by its known name. This class can be extended to return a bean object given its name, to set a value to an existing bean, or to create a bean with the value.- Since:
- EL 3.0
- See Also:
BeanNameELResolver
-
-
Constructor Summary
Constructors Constructor and Description BeanNameResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
canCreateBean(String beanName)
Allow creating a bean of the given name if it does not exist.Object
getBean(String beanName)
Returns the bean known by its name.boolean
isNameResolved(String beanName)
Returns whether the given name is resolved by the BeanNameResolverboolean
isReadOnly(String beanName)
Indicates if the bean of the given name is read-only or writablevoid
setBeanValue(String beanName, Object value)
Sets a value to a bean of the given name.
-
-
-
Method Detail
-
isNameResolved
public boolean isNameResolved(String beanName)
Returns whether the given name is resolved by the BeanNameResolver- Parameters:
beanName
- The name of the bean.- Returns:
- true if the name is resolved by this BeanNameResolver; false otherwise.
-
getBean
public Object getBean(String beanName)
Returns the bean known by its name.- Parameters:
beanName
- The name of the bean.- Returns:
- The bean with the given name. Can be
null
.
-
setBeanValue
public void setBeanValue(String beanName, Object value) throws PropertyNotWritableException
Sets a value to a bean of the given name. If the bean of the given name does not exist and ifcanCreateBean(java.lang.String)
istrue
, one is created with the given value.- Parameters:
beanName
- The name of the beanvalue
- The value to set the bean to. Can benull
.- Throws:
PropertyNotWritableException
- if the bean cannot be modified or created.
-
isReadOnly
public boolean isReadOnly(String beanName)
Indicates if the bean of the given name is read-only or writable- Parameters:
beanName
- The name of the bean- Returns:
true
if the bean can be set to a new value.false
otherwise.
-
canCreateBean
public boolean canCreateBean(String beanName)
Allow creating a bean of the given name if it does not exist.- Parameters:
beanName
- The name of the bean- Returns:
true
if bean creation is supportedfalse
otherwise.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/08/2025 02:00:41 Cette version de la page est en cache (à la date du 22/08/2025 02:00:41) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/el/beannameresolver.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.