com.itmusings.stm.ognl
Class MapAccessor

java.lang.Object
  extended by ognl.MapPropertyAccessor
      extended by com.itmusings.stm.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
protected static ognl.ObjectPropertyAccessor opa
           
 
Constructor Summary
MapAccessor()
           
 
Method Summary
 java.lang.Object getProperty(java.util.Map context, java.lang.Object target, java.lang.Object name)
           
 void setProperty(java.util.Map context, java.lang.Object target, java.lang.Object name, java.lang.Object value)
           
 
Methods inherited from class ognl.MapPropertyAccessor
getSourceAccessor, getSourceSetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opa

protected static ognl.ObjectPropertyAccessor opa
Constructor Detail

MapAccessor

public MapAccessor()
Method Detail

getProperty

public java.lang.Object getProperty(java.util.Map context,
                                    java.lang.Object target,
                                    java.lang.Object name)
                             throws ognl.OgnlException
Specified by:
getProperty in interface ognl.PropertyAccessor
Overrides:
getProperty in class ognl.MapPropertyAccessor
Throws:
ognl.OgnlException

setProperty

public void setProperty(java.util.Map context,
                        java.lang.Object target,
                        java.lang.Object name,
                        java.lang.Object value)
                 throws ognl.OgnlException
Specified by:
setProperty in interface ognl.PropertyAccessor
Overrides:
setProperty in class ognl.MapPropertyAccessor
Throws:
ognl.OgnlException


Copyright © 2011 ITMUSINGS. All Rights Reserved.