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 the getProperty(String),
setProperty(String, Object), isProperty(String) and properties()
methods.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanFields inherited from class javax.el.ELResolver
RESOLVABLE_AT_DESIGN_TIME, TYPE -
Constructor Summary
ConstructorsConstructorDescriptionCreate a read/write root property resolverRootPropertyResolver(boolean readOnly) Create a root property resolver -
Method Summary
Modifier and TypeMethodDescriptionClass<?> getCommonPropertyType(javax.el.ELContext context, Object base) getFeatureDescriptors(javax.el.ELContext context, Object base) getProperty(String property) Get property valueClass<?> invoke(javax.el.ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) booleanisProperty(String property) Test propertybooleanisReadOnly(javax.el.ELContext context, Object base, Object property) private booleanisResolvable(Object base) Get propertiesprivate booleanvoidsetProperty(String property, Object value) Set property valuevoidMethods inherited from class javax.el.ELResolver
convertToType
-
Field Details
-
map
-
readOnly
private final boolean readOnly
-
-
Constructor Details
-
RootPropertyResolver
public RootPropertyResolver()Create a read/write root property resolver -
RootPropertyResolver
public RootPropertyResolver(boolean readOnly) Create a root property resolver- Parameters:
readOnly-
-
-
Method Details
-
isResolvable
-
resolve
-
getCommonPropertyType
- Specified by:
getCommonPropertyTypein classjavax.el.ELResolver
-
getFeatureDescriptors
- Specified by:
getFeatureDescriptorsin classjavax.el.ELResolver
-
getType
- Specified by:
getTypein classjavax.el.ELResolver
-
getValue
- Specified by:
getValuein classjavax.el.ELResolver
-
isReadOnly
- Specified by:
isReadOnlyin classjavax.el.ELResolver
-
setValue
public void setValue(javax.el.ELContext context, Object base, Object property, Object value) throws javax.el.PropertyNotWritableException - Specified by:
setValuein classjavax.el.ELResolver- Throws:
javax.el.PropertyNotWritableException
-
invoke
public Object invoke(javax.el.ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) - Overrides:
invokein classjavax.el.ELResolver
-
getProperty
Get property value- Parameters:
property- property name- Returns:
- value associated with the given property
-
setProperty
Set property value- Parameters:
property- property namevalue- property value
-
isProperty
Test property- Parameters:
property- property name- Returns:
trueif the given property is associated with a value
-
properties
Get properties- Returns:
- all property names (in no particular order)
-