|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.PropertyEditorRegistrySupport
org.springframework.beans.AbstractPropertyAccessor
org.springframework.richclient.beans.AbstractMemberPropertyAccessor
public abstract class AbstractMemberPropertyAccessor
PropertyAccessor implementation that determines property types by field, if
available. Otherwise methods are used.
Actual access to properties is left for implementation for subclasses.
This implementation does not support nested properties. Use
AbstractNestedMemberPropertyAccessor
, if you need nested
property-support.
Field Summary |
---|
Fields inherited from interface org.springframework.beans.PropertyAccessor |
---|
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR |
Constructor Summary | |
---|---|
protected |
AbstractMemberPropertyAccessor(Class targetClass,
boolean fieldAccessEnabled)
Creates a new AbstractMemberPropertyAccessor. |
Method Summary | |
---|---|
protected boolean |
checkKeyTypes(String propertyName)
|
protected NotReadablePropertyException |
createNotReadablePropertyException(String propertyName,
Exception e)
|
Class |
getIndexedPropertyKeyType(String propertyName)
Determine the type of the key used to index the collection/map. |
protected abstract Object |
getIndexedPropertyValue(String propertyName)
Retrieve the value of an indexed property. |
protected Object[] |
getIndices(String propertyName)
|
protected String |
getParentPropertyName(String propertyName)
Return the parent property name of an indexed property or the empty string. |
protected Member |
getPropertyAccessor(String propertyName)
Return any accessor, be it read or write, for the given property. |
protected String |
getPropertyName(String methodName,
int prefixLength)
Returns the propertyName based on the methodName. |
Class |
getPropertyType(String propertyName)
|
Object |
getPropertyValue(String propertyName)
|
protected Member |
getReadPropertyAccessor(String propertyName)
Return the read accessor for the given property. |
protected String |
getRootPropertyName(String propertyName)
Returns the root property of an indexed property. |
protected abstract Object |
getSimplePropertyValue(String propertyName)
Retrieve the value of a simple property (non-indexed). |
Class |
getTargetClass()
Returns the class used to introspect members. |
protected Member |
getWritePropertyAccessor(String propertyName)
Return the write accessor for the given property. |
boolean |
isFieldAccessEnabled()
Returns whether this PropertyAccessor should inspect fields. |
boolean |
isReadableProperty(String propertyName)
|
boolean |
isWritableProperty(String propertyName)
|
protected Object |
setAssemblageValue(Class assemblageType,
Object assemblage,
Object index,
Object value)
Helper method for subclasses to set values of indexed properties, like map-values, collection-values or array-values. |
protected abstract void |
setIndexedPropertyValue(String propertyName,
Object value)
Set the value of an indexed property. |
void |
setPropertyValue(String propertyName,
Object value)
|
protected abstract void |
setSimplePropertyValue(String propertyName,
Object value)
Set the value of a simple property (non-indexed). |
protected void |
setTargetClass(Class targetClass)
Clears all cached members and introspect methods again. |
Methods inherited from class org.springframework.beans.AbstractPropertyAccessor |
---|
convertIfNecessary, isExtractOldValueForEditor, setExtractOldValueForEditor, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues |
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport |
---|
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, useConfigValueEditors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry |
---|
findCustomEditor, registerCustomEditor, registerCustomEditor |
Methods inherited from interface org.springframework.beans.TypeConverter |
---|
convertIfNecessary |
Constructor Detail |
---|
protected AbstractMemberPropertyAccessor(Class targetClass, boolean fieldAccessEnabled)
targetClass
- the target class.fieldAccessEnabled
- whether field access should be used for
property type determination.Method Detail |
---|
protected void setTargetClass(Class targetClass)
targetClass
- the target class.public boolean isFieldAccessEnabled()
public Class getTargetClass()
protected Member getReadPropertyAccessor(String propertyName)
propertyName
- name of the property.
null
.protected Member getWritePropertyAccessor(String propertyName)
propertyName
- name of the property.
null
.protected Member getPropertyAccessor(String propertyName)
propertyName
- name of the property.
null
public boolean isReadableProperty(String propertyName)
public boolean isWritableProperty(String propertyName)
public Class getPropertyType(String propertyName)
getPropertyType
in interface PropertyAccessor
getPropertyType
in class AbstractPropertyAccessor
public Class getIndexedPropertyKeyType(String propertyName)
propertyName
- name of the property.
String
if the jdk is less than 1.5, a specific type if the map was generified.public Object getPropertyValue(String propertyName) throws BeansException
getPropertyValue
in interface PropertyAccessor
getPropertyValue
in class AbstractPropertyAccessor
BeansException
public void setPropertyValue(String propertyName, Object value) throws BeansException
setPropertyValue
in interface PropertyAccessor
setPropertyValue
in class AbstractPropertyAccessor
BeansException
protected abstract Object getIndexedPropertyValue(String propertyName)
propertyName
- name of the property.
protected abstract Object getSimplePropertyValue(String propertyName)
propertyName
- name of the property.
protected abstract void setIndexedPropertyValue(String propertyName, Object value)
propertyName
- name of the property.value
- new value for the property.protected abstract void setSimplePropertyValue(String propertyName, Object value)
propertyName
- name of the property.value
- new value for the property.protected String getPropertyName(String methodName, int prefixLength)
methodName
- name of method to convert.prefixLength
- length of prefix to cut of.
protected String getRootPropertyName(String propertyName)
propertyName
- the name of the property.
protected String getParentPropertyName(String propertyName)
propertyName
- the name of the property.
protected boolean checkKeyTypes(String propertyName)
protected Object[] getIndices(String propertyName)
protected NotReadablePropertyException createNotReadablePropertyException(String propertyName, Exception e)
protected Object setAssemblageValue(Class assemblageType, Object assemblage, Object index, Object value)
assemblageType
- either map or collection or arrayassemblage
- the assemblage to set the value onindex
- the index to set the value atvalue
- the value to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |