Module jakarta.el
Package jakarta.el

Class BeanELResolver

java.lang.Object
jakarta.el.ELResolver
jakarta.el.BeanELResolver

public class BeanELResolver extends ELResolver
Defines property resolution behavior on objects using the JavaBeans component architecture.

If the java.beans.* package is available (part of the java.desktop module) the JavaBeans implementation provided by the JRE is used. If the java.beans.* package is not available, a built-in stand-alone implementation is used that just provides getter/setter support (as everything else requires classes from java.beans.*).

This resolver handles base objects of any type, as long as the base is not null. It accepts any object as a property or method, and coerces it to a string.

For property resolution, the property string is used to find a JavaBeans compliant property on the base object. The value is accessed using JavaBeans getters and setters.

For method resolution, the method string is the name of the method in the bean. The parameter types can be optionally specified to identify the method. If the parameter types are not specified, the parameter objects are used in the method resolution.

The JavaBeans specification predates the introduction of default method implementations defined on an interface. In addition to the JavaBeans specification requirements for looking up property getters, property setters and methods, this resolver also considers default methods and includes them in the results.

The JavaBeans specification predates the introduction of Modules. In addition to the JavaBeans specification requirements for looking up property getters, property setters and methods, this resolver also considers module visibility.

This resolver can be constructed in read-only mode, which means that isReadOnly will always return true and setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object) will always throw PropertyNotWritableException.

ELResolvers are combined together using CompositeELResolvers, to define rich semantics for evaluating an expression. See the javadocs for ELResolver for details.

Because this resolver handles base objects of any type, it should be placed near the end of a composite resolver. Otherwise, it will claim to have resolved a property before any resolvers that come after it get a chance to test if they can do so as well.

Since:
Jakarta Server Pages 2.1
See Also: