Top Description Constructors Methods
jakarta.el

public Class ResourceBundleELResolver

extends ELResolver
Class Inheritance
Imports
java.util.MissingResourceException, .ResourceBundle

Defines property resolution behavior on instances of java.util.ResourceBundle.

This resolver handles base objects of type java.util.ResourceBundle. It accepts any object as a property and coerces it to a java.lang.String for invoking java.util.ResourceBundle#getObject(java.lang.String).

This resolver is read only and will throw a PropertyNotWritableException if setValue is called.

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

Since
Jakarta Server Pages 2.1
See Also
CompositeELResolver, ELResolver, java.util.ResourceBundle

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

null if base is not a ResourceBundle; otherwise String.class.
getCommonPropertyType
(ELContext
The context of this evaluation.
context
,
Object
The bundle to analyze. Only bases of type ResourceBundle are handled by this resolver.
base
)

Implements abstract jakarta.el.ELResolver.getCommonPropertyType.

If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument.

public Class<?>

Returns:

If the propertyResolved property of ELContext was set to true, then null; otherwise undefined.
getType
(ELContext
The context of this evaluation.
context
,
Object
The ResourceBundle to analyze.
base
,
Object
The name of the property to analyze.
property
)

Implements abstract jakarta.el.ELResolver.getType.

If the base object is an instance of ResourceBundle, return null, since the resolver is read only.

public Object

Returns:

If the propertyResolved property of ELContext was set to true, then null if property is null; otherwise the Object for the given key (property coerced to String) from the ResourceBundle. If no object for the given key can be found, then the String "???" + key + "???".
getValue
(ELContext
The context of this evaluation.
context
,
Object
The ResourceBundle to analyze.
base
,
Object
The name of the property to analyze. Will be coerced to a String.
property
)

Implements abstract jakarta.el.ELResolver.getValue.

If the base object is an instance of ResourceBundle, the provided property will first be coerced to a String.

public boolean

Returns:

If the propertyResolved property of ELContext was set to true, then true; otherwise undefined.
isReadOnly
(ELContext
The context of this evaluation.
context
,
Object
The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.
base
,
Object
The String property to use.
property
)

Implements abstract jakarta.el.ELResolver.isReadOnly.

If the base object is not null and an instanceof ResourceBundle, return true.

public void
setValue(ELContext
The context of this evaluation.
context
,
Object
The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.
base
,
Object
The String property to use.
property
,
Object
The value to be set.
value
)

Implements abstract jakarta.el.ELResolver.setValue.

If the base object is a ResourceBundle, throw a PropertyNotWritableException.

Inherited from jakarta.el.ELResolver:
convertToTypeinvoke

Constructor Detail

ResourceBundleELResolverback to summary
public ResourceBundleELResolver()

Method Detail

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

Implements abstract jakarta.el.ELResolver.getCommonPropertyType.

If the base object is a ResourceBundle, returns the most general type that this resolver accepts for the property argument. Otherwise, returns null.

Assuming the base is a ResourceBundle, this method will always return String.class.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The bundle to analyze. Only bases of type ResourceBundle are handled by this resolver.

Returns:Class<?>

null if base is not a ResourceBundle; otherwise String.class.

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 ResourceBundle, return null, since the resolver is read only.

If the base is ResourceBundle, the propertyResolved property of the ELContext object 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 ResourceBundle to analyze.

property:Object

The name of the property to analyze.

Returns:Class<?>

If the propertyResolved property of ELContext was set to true, then null; otherwise undefined.

Annotations
@Override
Exceptions
NullPointerException:
if context is null
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 ResourceBundle, the provided property will first be coerced to a String. The Object returned by getObject on the base ResourceBundle will be returned.

If the base is ResourceBundle, the propertyResolved property of the ELContext object 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 ResourceBundle to analyze.

property:Object

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

Returns:Object

If the propertyResolved property of ELContext was set to true, then null if property is null; otherwise the Object for the given key (property coerced to String) from the ResourceBundle. If no object for the given key can be found, then the String "???" + key + "???".

Annotations
@Override
Exceptions
NullPointerException:
if context is null
ELException:
if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property 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 not null and an instanceof ResourceBundle, return true.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.

property:Object

The String property to use.

Returns:boolean

If the propertyResolved property of ELContext was set to true, then true; otherwise undefined.

Annotations
@Override
Exceptions
NullPointerException:
if context is null
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 a ResourceBundle, throw a PropertyNotWritableException.

Parameters
context:ELContext

The context of this evaluation.

base:Object

The ResourceBundle to be modified. Only bases that are of type ResourceBundle are handled.

property:Object

The String property to use.

value:Object

The value to be set.

Annotations
@Override
Exceptions
NullPointerException:
if context is null.
PropertyNotWritableException:
Always thrown if base is an instance of ReasourceBundle.