Top Description Constructors Methods
javax.el

public abstract Class BeanNameResolver

extends Object
Class Inheritance
Known Direct Subclasses
javax.el.StandardELContext.LocalBeanNameResolver

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if bean creation is supported false otherwise.
canCreateBean
(String
The name of the bean
beanName
)

Allow creating a bean of the given name if it does not exist.

public Object

Returns:

The bean with the given name. Can be null.
getBean
(String
The name of the bean.
beanName
)

Returns the bean known by its name.

public boolean

Returns:

true if the name is resolved by this BeanNameResolver; false otherwise.
isNameResolved
(String
The name of the bean.
beanName
)

Returns whether the given name is resolved by the BeanNameResolver

public boolean

Returns:

true if the bean can be set to a new value. false otherwise.
isReadOnly
(String
The name of the bean
beanName
)

Indicates if the bean of the given name is read-only or writable

public void
setBeanValue(String
The name of the bean
beanName
,
Object
The value to set the bean to. Can be null.
value
)

Sets a value to a bean of the given name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BeanNameResolverback to summary
public BeanNameResolver()

Method Detail

canCreateBeanback to summary
public boolean canCreateBean(String beanName)

Allow creating a bean of the given name if it does not exist.

Parameters
beanName:String

The name of the bean

Returns:boolean

true if bean creation is supported false otherwise.

getBeanback to summary
public Object getBean(String beanName)

Returns the bean known by its name.

Parameters
beanName:String

The name of the bean.

Returns:Object

The bean with the given name. Can be null.

isNameResolvedback to summary
public boolean isNameResolved(String beanName)

Returns whether the given name is resolved by the BeanNameResolver

Parameters
beanName:String

The name of the bean.

Returns:boolean

true if the name is resolved by this BeanNameResolver; false otherwise.

isReadOnlyback to summary
public boolean isReadOnly(String beanName)

Indicates if the bean of the given name is read-only or writable

Parameters
beanName:String

The name of the bean

Returns:boolean

true if the bean can be set to a new value. false otherwise.

setBeanValueback to summary
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 if canCreateBean is true, one is created with the given value.

Parameters
beanName:String

The name of the bean

value:Object

The value to set the bean to. Can be null.

Exceptions
PropertyNotWritableException:
if the bean cannot be modified or created.