| java.lang.Object com.opensymphony.xwork.util.DefaultObjectTypeDeterminer
DefaultObjectTypeDeterminer | public class DefaultObjectTypeDeterminer implements ObjectTypeDeterminer(Code) | |
This
ObjectTypeDeterminer looks at the Class-conversion.properties for entries that indicated what
objects are contained within Maps and Collections. For Collections, such as Lists, the element is specified using the
pattern Element_xxx, where xxx is the field name of the collection property in your action or object. For
Maps, both the key and the value may be specified by using the pattern Key_xxx and Element_xxx,
respectively.
From WebWork 2.1.x, the Collection_xxx format is still supported and honored, although it is deprecated
and will be removed eventually.
author: Gabriel Zimmerman See Also: XWorkListPropertyAccessor See Also: XWorkCollectionPropertyAccessor See Also: XWorkMapPropertyAccessor |
Method Summary | |
public Class | getElementClass(Class parentClass, String property, Object key) Determines the key class by looking for the value of Element_${property} in the properties file for the given
class. | public Class | getKeyClass(Class parentClass, String property) Determines the key class by looking for the value of Key_${property} in the properties file for the given class. | public String | getKeyProperty(Class parentClass, String property) Determines the String key property for a Collection by getting it from the conversion properties file using the
KeyProperty_ prefix. | public boolean | shouldCreateIfNew(Class parentClass, String property, Object target, String keyProperty, boolean isIndexAccessed) Determines the boolean CreateIfNull property for a Collection or Map by getting it from the conversion properties
file using the CreateIfNull_ prefix. |
CREATE_IF_NULL_PREFIX | final public static String CREATE_IF_NULL_PREFIX(Code) | | |
DEPRECATED_ELEMENT_PREFIX | final public static String DEPRECATED_ELEMENT_PREFIX(Code) | | |
ELEMENT_PREFIX | final public static String ELEMENT_PREFIX(Code) | | |
KEY_PROPERTY_PREFIX | final public static String KEY_PROPERTY_PREFIX(Code) | | |
LOG | final protected static Log LOG(Code) | | |
getElementClass | public Class getElementClass(Class parentClass, String property, Object key)(Code) | | Determines the key class by looking for the value of Element_${property} in the properties file for the given
class. Also looks for the deprecated Collection_${property}
Parameters: parentClass - the Class which contains as a property the Map or Collection we are finding the key for. Parameters: property - the property of the Map or Collection for the given parent class See Also: ObjectTypeDeterminer.getElementClass(ClassStringObject) |
getKeyClass | public Class getKeyClass(Class parentClass, String property)(Code) | | Determines the key class by looking for the value of Key_${property} in the properties file for the given class.
Parameters: parentClass - the Class which contains as a property the Map or Collection we are finding the key for. Parameters: property - the property of the Map or Collection for the given parent class See Also: ObjectTypeDeterminer.getKeyClass(ClassString) |
getKeyProperty | public String getKeyProperty(Class parentClass, String property)(Code) | | Determines the String key property for a Collection by getting it from the conversion properties file using the
KeyProperty_ prefix. KeyProperty_${property}=somePropertyOfBeansInTheSet
Parameters: parentClass - the Class which contains as a property the Map or Collection we are finding the KeyProperty for. Parameters: property - the property of the Map or Collection for the given parent class |
shouldCreateIfNew | public boolean shouldCreateIfNew(Class parentClass, String property, Object target, String keyProperty, boolean isIndexAccessed)(Code) | | Determines the boolean CreateIfNull property for a Collection or Map by getting it from the conversion properties
file using the CreateIfNull_ prefix. CreateIfNull_${property}=true|false
Parameters: parentClass - the Class which contains as a property the Map or Collection we are finding the CreateIfNull for. Parameters: property - the property of the Map or Collection for the given parent class Parameters: target - Parameters: keyProperty - Parameters: isIndexAccessed - true, if the Collection or Map should be created, false otherwise. |
|
|