Package org.chenile.ognl
Class MapAccessor
java.lang.Object
ognl.MapPropertyAccessor
org.chenile.ognl.MapAccessor
- All Implemented Interfaces:
ognl.PropertyAccessor
public class MapAccessor
extends ognl.MapPropertyAccessor
Allows Ognl to support an object that is a map with a few properties defined like normal
java beans. The out of the box MapPropertyAccessor does not support java bean style access.
Ex: public class Foo extends HashMap {
private String bar;
// getters and setters for bar.
}
In this case, MapPropertyAccessor cannot set or get values to bar since it is defined as a
normal bean property.
This class helps out and leverages both the functionalities of the MapPropertyAccessor and
ObjectPropertyAccessor.
- Author:
- raja
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetProperty
(Map context, Object target, Object name) void
setProperty
(Map context, Object target, Object name, Object value) Methods inherited from class ognl.MapPropertyAccessor
getSourceAccessor, getSourceSetter
-
Field Details
-
opa
protected static ognl.ObjectPropertyAccessor opa
-
-
Constructor Details
-
MapAccessor
public MapAccessor()
-
-
Method Details
-
getProperty
- Specified by:
getProperty
in interfaceognl.PropertyAccessor
- Overrides:
getProperty
in classognl.MapPropertyAccessor
- Throws:
ognl.OgnlException
-
setProperty
public void setProperty(Map context, Object target, Object name, Object value) throws ognl.OgnlException - Specified by:
setProperty
in interfaceognl.PropertyAccessor
- Overrides:
setProperty
in classognl.MapPropertyAccessor
- Throws:
ognl.OgnlException
-