javax.el
Class BeanNameResolver

java.lang.Object
  extended by javax.el.BeanNameResolver

public abstract class BeanNameResolver
extends java.lang.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
BeanNameResolver()
           
 
Method Summary
 boolean canCreateBean(java.lang.String beanName)
          Allow creating a bean of the given name if it does not exist.
 java.lang.Object getBean(java.lang.String beanName)
          Returns the bean known by its name.
 boolean isNameResolved(java.lang.String beanName)
          Returns whether the given name is resolved by the BeanNameResolver
 boolean isReadOnly(java.lang.String beanName)
          Indicates if the bean of the given name is read-only or writable
 void setBeanValue(java.lang.String beanName, java.lang.Object value)
          Sets a value to a bean of the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanNameResolver

public BeanNameResolver()
Method Detail

isNameResolved

public boolean isNameResolved(java.lang.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 java.lang.Object getBean(java.lang.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(java.lang.String beanName,
                         java.lang.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(java.lang.String) is true, one is created with the given value.

Parameters:
beanName - The name of the bean
value - The value to set the bean to. Can be null.
Throws:
PropertyNotWritableException - if the bean cannot be modified or created.

isReadOnly

public boolean isReadOnly(java.lang.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(java.lang.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 supported false otherwise.


Copyright (c) 1999-2012 Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.