public class ResourceBundleELResolver extends ELResolver
PropertyNotWritableException
if setValue is
called. ELResolvers are combined together using CompositeELResolver
s, to define rich
semantics for evaluating an expression. See the javadocs for ELResolver
for details.RESOLVABLE_AT_DESIGN_TIME, TYPE
Constructor and Description |
---|
ResourceBundleELResolver() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getCommonPropertyType(ELContext context,
Object base)
If the base object is a ResourceBundle, returns the most general type that this resolver
accepts for the property argument.
|
Iterator<FeatureDescriptor> |
getFeatureDescriptors(ELContext context,
Object base)
If the base object is a ResourceBundle, returns an Iterator containing the set of keys
available in the ResourceBundle.
|
Class<?> |
getType(ELContext context,
Object base,
Object property)
If the base object is an instance of ResourceBundle, return null, since the resolver is read
only.
|
Object |
getValue(ELContext context,
Object base,
Object property)
If the base object is an instance of ResourceBundle, the provided property will first be
coerced to a String.
|
boolean |
isReadOnly(ELContext context,
Object base,
Object property)
If the base object is not null and an instanceof java.util.ResourceBundle, return true.
|
void |
setValue(ELContext context,
Object base,
Object property,
Object value)
If the base object is a ResourceBundle, throw a
PropertyNotWritableException . |
invoke
public Class<?> getCommonPropertyType(ELContext context, Object base)
getCommonPropertyType
in class ELResolver
context
- The context of this evaluation.base
- The bundle to analyze. Only bases of type ResourceBundle are handled by this
resolver.public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
ELResolver.TYPE
- String.class.ELResolver.RESOLVABLE_AT_DESIGN_TIME
- truegetFeatureDescriptors
in class ELResolver
context
- The context of this evaluation.base
- The bundle to analyze. Only bases of type ResourceBundle are handled by this
resolver.public Class<?> getType(ELContext context, Object base, Object property)
getType
in class ELResolver
context
- The context of this evaluation.base
- The bundle to analyze. Only bases of type ResourceBundle are handled by this
resolver.property
- The name of the property to analyze.NullPointerException
- if context is nullpublic Object getValue(ELContext context, Object base, Object property)
getValue
in class ELResolver
context
- The context of this evaluation.base
- The bundle to analyze. Only bases of type ResourceBundle are handled by this
resolver.property
- The name of the property to analyze. Will be coerced to a String.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.public boolean isReadOnly(ELContext context, Object base, Object property)
isReadOnly
in class ELResolver
context
- The context of this evaluation.base
- The base object whose property value is to be analyzed, or null to analyze a
top-level variable.property
- The property or variable to return the read-only status for.NullPointerException
- if context is null.public void setValue(ELContext context, Object base, Object property, Object value)
PropertyNotWritableException
.setValue
in class ELResolver
context
- The context of this evaluation.base
- The bundle to analyze. Only bases of type ResourceBundle are handled by this
resolver.property
- The name of the property to analyze. Will be coerced to a String.value
- The value to be set.NullPointerException
- if context is null.PropertyNotWritableException
- Always thrown if base is an instance of ResourceBundle.Copyright © 2015. All rights reserved.