BeanNameResolver (EL 6.0 API Documentation - Apache Tomcat 11.0.25)
Description: declaration: package: jakarta.el, class: BeanNameResolver

# Class BeanNameResolver

java.lang.Object
jakarta.el.BeanNameResolver

public abstract class BeanNameResolver extends Object
Base implementation that provides a minimal default implementation that is intended to be extended by application developers. Subclasses define the logic for resolving bean names to bean instances, checking read-only status, and determining whether new beans can be created.

Since:
  EL 3.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BeanNameResolver()`
  Default constructor for subclasses.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `canCreateBean(String beanName)`
  Is it permitted to create a bean of the given name?
  `Object`
  `getBean(String beanName)`
  Returns the named bean.
  `boolean`
  `isNameResolved(String beanName)`
  Can this resolver resolve the given bean name?
  `boolean`
  `isReadOnly(String beanName)`
  Is the named bean read-only?
  `void`
  `setBeanValue(String beanName, Object value)`
  Sets a value of a bean of the given name.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### BeanNameResolver

    public BeanNameResolver()
    Default constructor for subclasses.

- ## Method Details

  - ### isNameResolved

    public boolean isNameResolved(String beanName)
    Can this resolver resolve the given bean name?
    Parameters:
      `beanName` - The bean name to resolve
    Returns:
      This default implementation always returns `false`

  - ### getBean

    public Object getBean(String beanName)
    Returns the named bean.
    Parameters:
      `beanName` - The bean name to return
    Returns:
      This default implementation always returns `null`

  - ### setBeanValue

    public void setBeanValue(String beanName, Object value) throws PropertyNotWritableException
    Sets a value of a bean of the given name. If the named bean does not exist and `canCreateBean(String)` returns `true` then a bean is created with the given value.
    Parameters:
      `beanName` - The name of the bean to be set/create
      `value` - The value of the bean to set/create
    Throws:
      `PropertyNotWritableException` - if the bean is read only

  - ### isReadOnly

    public boolean isReadOnly(String beanName)
    Is the named bean read-only?
    Parameters:
      `beanName` - The name of the bean of interest
    Returns:
      `true` if the bean is read only, otherwise `false`

  - ### canCreateBean

    public boolean canCreateBean(String beanName)
    Is it permitted to create a bean of the given name?
    Parameters:
      `beanName` - The name of the bean of interest
    Returns:
      `true` if the bean may be created, otherwise `false`