|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.util.DefaultObjectTypeDeterminer
public class DefaultObjectTypeDeterminer
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.
XWorkListPropertyAccessor
,
XWorkCollectionPropertyAccessor
,
XWorkMapPropertyAccessor
Field Summary | |
---|---|
static java.lang.String |
CREATE_IF_NULL_PREFIX
|
static java.lang.String |
DEPRECATED_ELEMENT_PREFIX
|
static java.lang.String |
ELEMENT_PREFIX
|
static java.lang.String |
KEY_PREFIX
|
static java.lang.String |
KEY_PROPERTY_PREFIX
|
protected static org.apache.commons.logging.Log |
LOG
|
Constructor Summary | |
---|---|
DefaultObjectTypeDeterminer()
|
Method Summary | |
---|---|
java.lang.Class |
getElementClass(java.lang.Class parentClass,
java.lang.String property,
java.lang.Object key)
Determines the key class by looking for the value of Element_${property} in the properties file for the given class. |
java.lang.Class |
getKeyClass(java.lang.Class parentClass,
java.lang.String property)
Determines the key class by looking for the value of Key_${property} in the properties file for the given class. |
java.lang.String |
getKeyProperty(java.lang.Class parentClass,
java.lang.String property)
Determines the String key property for a Collection by getting it from the conversion properties file using the KeyProperty_ prefix. |
boolean |
shouldCreateIfNew(java.lang.Class parentClass,
java.lang.String property,
java.lang.Object target,
java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
public static final java.lang.String KEY_PREFIX
public static final java.lang.String ELEMENT_PREFIX
public static final java.lang.String KEY_PROPERTY_PREFIX
public static final java.lang.String CREATE_IF_NULL_PREFIX
public static final java.lang.String DEPRECATED_ELEMENT_PREFIX
Constructor Detail |
---|
public DefaultObjectTypeDeterminer()
Method Detail |
---|
public java.lang.Class getKeyClass(java.lang.Class parentClass, java.lang.String property)
getKeyClass
in interface ObjectTypeDeterminer
parentClass
- the Class which contains as a property the Map or Collection we are finding the key for.property
- the property of the Map or Collection for the given parent classObjectTypeDeterminer.getKeyClass(Class, String)
public java.lang.Class getElementClass(java.lang.Class parentClass, java.lang.String property, java.lang.Object key)
getElementClass
in interface ObjectTypeDeterminer
parentClass
- the Class which contains as a property the Map or Collection we are finding the key for.property
- the property of the Map or Collection for the given parent classObjectTypeDeterminer.getElementClass(Class, String, Object)
public java.lang.String getKeyProperty(java.lang.Class parentClass, java.lang.String property)
getKeyProperty
in interface ObjectTypeDeterminer
parentClass
- the Class which contains as a property the Map or Collection we are finding the KeyProperty for.property
- the property of the Map or Collection for the given parent classpublic boolean shouldCreateIfNew(java.lang.Class parentClass, java.lang.String property, java.lang.Object target, java.lang.String keyProperty, boolean isIndexAccessed)
shouldCreateIfNew
in interface ObjectTypeDeterminer
parentClass
- the Class which contains as a property the Map or Collection we are finding the CreateIfNull for.property
- the property of the Map or Collection for the given parent classtarget
- keyProperty
- isIndexAccessed
-
|
XWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |