Top Description Constructors Methods
jakarta.el

public Class RecordELResolver

extends ELResolver
Class Inheritance
Static Imports
jakarta.el.ELUtil.getExceptionMessageString

Defines property resolution behavior on instances of Record.

The resolver handles base objects of type Record. It accepts any non-null object as a property and coerces it to a String using Object#toString(). The property string is used to find an accessor method for a field with the same name.

This resolver is always read-only since Records are always read-only.

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

Object is base is an instance of Record, otherwise null.
getCommonPropertyType
(ELContext
The context of this evaluation.
context
,
Object
The Record to analyze.
base
)

Implements abstract jakarta.el.ELResolver.getCommonPropertyType.

If the base object is an instance of Record, returns the most general type this resolver accepts for the property argument.

public Class<?>

Returns:

Always null
getType
(ELContext
The context of this evaluation.
context
,
Object
The Record to analyze.
base
,
Object
The name of the property to analyze. Will be coerced to a String.
property
)

Implements abstract jakarta.el.ELResolver.getType.

If the base object is an instance of Record, always returns null since Records are always read-only.

public Object

Returns:

If the propertyResolved property of the provided ELContext was set to true then the value of the given property. Otherwise, undefined.
getValue
(ELContext
The context of this evaluation.
context
,
Object
The Record on which to get the property.
base
,
Object
The property to get. Will be coerced to a String.
property
)

Implements abstract jakarta.el.ELResolver.getValue.

If the base object is an instance of Record, returns the value of the given field of this Record.

public boolean
isReadOnly(ELContext
The context of this evaluation.
context
,
Object
The Record to analyze.
base
,
Object
The name of the property to analyze. Will be coerced to a String.
property
)

Implements abstract jakarta.el.ELResolver.isReadOnly.

If the base object is an instance of Record, always returns true.

public void
setValue(ELContext
The context of this evaluation.
context
,
Object
The Record on which to set the property.
base
,
Object
The name of the property to set. Will be coerced to a String.
property
,
Object
The value to set the property or variable to.
value
)

Implements abstract jakarta.el.ELResolver.setValue.

If the base object is an instance of Record, always throws an exception since Records are read-only.

Inherited from jakarta.el.ELResolver:
convertToTypeinvoke

Constructor Detail

RecordELResolverback to summary
public RecordELResolver()

Method Detail

getCommonPropertyTypeback to summary
public Class<?> getCommonPropertyType(ELContext context, Object base)

Implements abstract jakarta.el.ELResolver.getCommonPropertyType.

If the base object is an instance of Record, returns the most general type this resolver accepts for the property argument. Otherwise, returns null.

If the base object is an instance of Record this method will always return Object since any object is accepted for the property argument and coerced to a String.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The Record to analyze.

Returns:Class<?>

Object is base is an instance of Record, otherwise null.

Annotations
@Override
getTypeback to summary
public Class<?> getType(ELContext context, Object base, Object property)

Implements abstract jakarta.el.ELResolver.getType.

If the base object is an instance of Record, always returns null since Records are always read-only.

If the base object is an instance of Record, the propertyResolved property of the provided ELContext must be set to true by this resolver before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The Record to analyze.

property:Object

The name of the property to analyze. Will be coerced to a String.

Returns:Class<?>

Always null

Annotations
@Override
Exceptions
NullPointerException:
if the provided ELContext is null.
PropertyNotFoundException:
if the base is an instance of Record and the specified property does not exist.
getValueback to summary
public Object getValue(ELContext context, Object base, Object property)

Implements abstract jakarta.el.ELResolver.getValue.

If the base object is an instance of Record, returns the value of the given field of this Record.

If the base object is an instance of Record, the propertyResolved property of the provided ELContext must be set to true by this resolver before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The Record on which to get the property.

property:Object

The property to get. Will be coerced to a String.

Returns:Object

If the propertyResolved property of the provided ELContext was set to true then the value of the given property. Otherwise, undefined.

Annotations
@Override
Exceptions
NullPointerException:
if the provided ELContext is null.
PropertyNotFoundException:
if the base is an instance of Record and the specified property does not exist.
ELException:
if an exception was thrown while performing the property resolution. The thrown exception must be included as the cause of this exception, if available.
isReadOnlyback to summary
public boolean isReadOnly(ELContext context, Object base, Object property)

Implements abstract jakarta.el.ELResolver.isReadOnly.

If the base object is an instance of Record, always returns true.

If the base object is an instance of Record, the propertyResolved property of the provided ELContext must be set to true by this resolver before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The Record to analyze.

property:Object

The name of the property to analyze. Will be coerced to a String.

Returns:boolean

Doc from jakarta.el.ELResolver.isReadOnly.

If the propertyResolved property of ELContext was set to true, then true if the property is read-only or false if not; otherwise undefined.

Annotations
@Override
Exceptions
NullPointerException:
if the provided ELContext is null.
PropertyNotFoundException:
if the base is an instance of Record and the specified property does not exist.
setValueback to summary
public void setValue(ELContext context, Object base, Object property, Object value)

Implements abstract jakarta.el.ELResolver.setValue.

If the base object is an instance of Record, always throws an exception since Records are read-only.

If the base object is an instance of Record, the propertyResolved property of the provided ELContext must be set to true by this resolver before returning. If this property is not true after this method is called, the caller should ignore the return value.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The Record on which to set the property.

property:Object

The name of the property to set. Will be coerced to a String.

value:Object

Doc from jakarta.el.ELResolver.setValue.

The value to set the property or variable to.

Annotations
@Override
Exceptions
NullPointerException:
if the provided ELContext is null.
PropertyNotFoundException:
if the base is an instance of Record and the specified property does not exist.
PropertyNotWritableException:
if the base is an instance of Record and the specified property exists.