com.opensymphony.xwork2.util
Class XWorkCollectionPropertyAccessor

java.lang.Object
  extended by ognl.ObjectPropertyAccessor
      extended by ognl.SetPropertyAccessor
          extended by com.opensymphony.xwork2.util.XWorkCollectionPropertyAccessor
All Implemented Interfaces:
ognl.PropertyAccessor

public class XWorkCollectionPropertyAccessor
extends ognl.SetPropertyAccessor

Author:
Gabe

Field Summary
private  ognl.ObjectPropertyAccessor _accessor
           
private static String CONTEXT_COLLECTION_MAP
           
static String KEY_PROPERTY_FOR_CREATION
           
private static Log LOG
           
 
Constructor Summary
XWorkCollectionPropertyAccessor()
           
 
Method Summary
 Object getProperty(Map context, Object target, Object key)
          Gets the property of a Collection by indexing the collection based on a key property.
 Object getPropertyThroughIteration(Map context, Collection collection, String property, Object key)
           
private  Map getSetMap(Map context, Collection collection, String property, Class valueClass)
           
 void setProperty(Map arg0, Object arg1, Object arg2, Object arg3)
           
 
Methods inherited from class ognl.ObjectPropertyAccessor
getPossibleProperty, hasGetProperty, hasGetProperty, hasSetProperty, hasSetProperty, setPossibleProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

CONTEXT_COLLECTION_MAP

private static final String CONTEXT_COLLECTION_MAP
See Also:
Constant Field Values

KEY_PROPERTY_FOR_CREATION

public static final String KEY_PROPERTY_FOR_CREATION
See Also:
Constant Field Values

_accessor

private ognl.ObjectPropertyAccessor _accessor
Constructor Detail

XWorkCollectionPropertyAccessor

public XWorkCollectionPropertyAccessor()
Method Detail

getProperty

public Object getProperty(Map context,
                          Object target,
                          Object key)
                   throws ognl.OgnlException
Gets the property of a Collection by indexing the collection based on a key property. For example, if the key property were 'id', this method would convert the key Object to whatever type the id property was, and then access the Set like it was a Map returning a JavaBean with the value of id property matching the input.

Specified by:
getProperty in interface ognl.PropertyAccessor
Overrides:
getProperty in class ognl.SetPropertyAccessor
Throws:
ognl.OgnlException
See Also:
PropertyAccessor.getProperty(java.util.Map, Object, Object)

getSetMap

private Map getSetMap(Map context,
                      Collection collection,
                      String property,
                      Class valueClass)
               throws ognl.OgnlException
Throws:
ognl.OgnlException

getPropertyThroughIteration

public Object getPropertyThroughIteration(Map context,
                                          Collection collection,
                                          String property,
                                          Object key)
                                   throws ognl.OgnlException
Throws:
ognl.OgnlException

setProperty

public void setProperty(Map arg0,
                        Object arg1,
                        Object arg2,
                        Object arg3)
                 throws ognl.OgnlException
Specified by:
setProperty in interface ognl.PropertyAccessor
Overrides:
setProperty in class ognl.ObjectPropertyAccessor
Throws:
ognl.OgnlException


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.