Package de.odysseus.el.util
Class RootPropertyResolver
- java.lang.Object
-
- javax.el.ELResolver
-
- de.odysseus.el.util.RootPropertyResolver
-
public class RootPropertyResolver extends javax.el.ELResolver
Simple root property resolver implementation. This resolver handles root properties (i.e.base == null && property instanceof String
), which are stored in a map. The properties can be accessed via thegetProperty(String)
,setProperty(String, Object)
,isProperty(String)
andproperties()
methods.
-
-
Constructor Summary
Constructors Constructor Description RootPropertyResolver()
Create a read/write root property resolverRootPropertyResolver(boolean readOnly)
Create a root property resolver
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
getCommonPropertyType(javax.el.ELContext context, java.lang.Object base)
java.util.Iterator<java.beans.FeatureDescriptor>
getFeatureDescriptors(javax.el.ELContext context, java.lang.Object base)
java.lang.Object
getProperty(java.lang.String property)
Get property valuejava.lang.Class<?>
getType(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
java.lang.Object
getValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
java.lang.Object
invoke(javax.el.ELContext context, java.lang.Object base, java.lang.Object method, java.lang.Class<?>[] paramTypes, java.lang.Object[] params)
boolean
isProperty(java.lang.String property)
Test propertyboolean
isReadOnly(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
private boolean
isResolvable(java.lang.Object base)
java.lang.Iterable<java.lang.String>
properties()
Get propertiesprivate boolean
resolve(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
void
setProperty(java.lang.String property, java.lang.Object value)
Set property valuevoid
setValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property, java.lang.Object value)
-
-
-
Method Detail
-
isResolvable
private boolean isResolvable(java.lang.Object base)
-
resolve
private boolean resolve(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
-
getCommonPropertyType
public java.lang.Class<?> getCommonPropertyType(javax.el.ELContext context, java.lang.Object base)
- Specified by:
getCommonPropertyType
in classjavax.el.ELResolver
-
getFeatureDescriptors
public java.util.Iterator<java.beans.FeatureDescriptor> getFeatureDescriptors(javax.el.ELContext context, java.lang.Object base)
- Specified by:
getFeatureDescriptors
in classjavax.el.ELResolver
-
getType
public java.lang.Class<?> getType(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
- Specified by:
getType
in classjavax.el.ELResolver
-
getValue
public java.lang.Object getValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
- Specified by:
getValue
in classjavax.el.ELResolver
-
isReadOnly
public boolean isReadOnly(javax.el.ELContext context, java.lang.Object base, java.lang.Object property)
- Specified by:
isReadOnly
in classjavax.el.ELResolver
-
setValue
public void setValue(javax.el.ELContext context, java.lang.Object base, java.lang.Object property, java.lang.Object value) throws javax.el.PropertyNotWritableException
- Specified by:
setValue
in classjavax.el.ELResolver
- Throws:
javax.el.PropertyNotWritableException
-
invoke
public java.lang.Object invoke(javax.el.ELContext context, java.lang.Object base, java.lang.Object method, java.lang.Class<?>[] paramTypes, java.lang.Object[] params)
- Overrides:
invoke
in classjavax.el.ELResolver
-
getProperty
public java.lang.Object getProperty(java.lang.String property)
Get property value- Parameters:
property
- property name- Returns:
- value associated with the given property
-
setProperty
public void setProperty(java.lang.String property, java.lang.Object value)
Set property value- Parameters:
property
- property namevalue
- property value
-
isProperty
public boolean isProperty(java.lang.String property)
Test property- Parameters:
property
- property name- Returns:
true
if the given property is associated with a value
-
properties
public java.lang.Iterable<java.lang.String> properties()
Get properties- Returns:
- all property names (in no particular order)
-
-