|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.binding.support.AbstractPropertyAccessStrategy
public abstract class AbstractPropertyAccessStrategy
An abstract implementation of MutablePropertyAccessStrategy
that provides support for concrete implementations.
As this class delegates to a PropertyAccessor for property
access, the support for type resolution and nested properties depends
on the implementation of the PropertyAccessor
| Constructor Summary | |
|---|---|
protected |
AbstractPropertyAccessStrategy(AbstractPropertyAccessStrategy parent,
String basePropertyPath)
Creates a child instance of AbstractPropertyAccessStrategy that will delegate to its parent for property access. |
|
AbstractPropertyAccessStrategy(Object object)
Creates a new instance of AbstractPropertyAccessStrategy that will provide access to the properties of the provided object. |
|
AbstractPropertyAccessStrategy(ValueModel domainObjectHolder)
Creates a new instance of AbstractPropertyAccessStrategy that will provide access to the object contained by the provided value model. |
| Method Summary | |
|---|---|
protected abstract void |
domainObjectChanged()
Called when the domain object is changed. |
protected Map |
getAllUserMetadataFor(String propertyPath)
Subclasses may override this method to supply user metadata for the specified propertyPath. |
Object |
getDomainObject()
Return the target, backing domain object for which property access requests are targeted against. |
ValueModel |
getDomainObjectHolder()
Get the ValueModel used to access the domainObject. |
protected String |
getFullPropertyPath(String propertyPath)
Returns a property path that includes the base property path of the class. |
protected int |
getLastPropertySeparatorIndex(String propertyPath)
Returns the index of the last nested property separator in the given property path, ignoring dots in keys (like "map[my.key]"). |
PropertyMetadataAccessStrategy |
getMetadataAccessStrategy()
Get a metadata accessor, which can return meta information about particular properties of the backed domain object. |
protected String |
getParentPropertyPath(String propertyPath)
Returns the property name component of the provided property path. |
protected abstract PropertyAccessor |
getPropertyAccessor()
|
abstract MutablePropertyAccessStrategy |
getPropertyAccessStrategyForPath(String propertyPath)
Get a MutablePropertyAccessStrategy for the given
property. |
protected String |
getPropertyName(String propertyPath)
Extracts the property name from a propertyPath. |
Object |
getPropertyValue(String propertyPath)
Get the value of a property. |
ValueModel |
getPropertyValueModel(String propertyPath)
Get the ValueModel to access the given property. |
protected Object |
getUserMetadataFor(String propertyPath,
String key)
Subclasses may override this method to supply user metadata for the specified propertyPath and key. |
abstract MutablePropertyAccessStrategy |
newPropertyAccessStrategy(ValueModel domainObjectHolder)
Return a new MutablePropertyAccessStrategy for the given
valueModel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPropertyAccessStrategy(Object object)
object - the object to be accessed through this class.public AbstractPropertyAccessStrategy(ValueModel domainObjectHolder)
domainObjectHolder - value model that holds the object to be
accessed through this class
protected AbstractPropertyAccessStrategy(AbstractPropertyAccessStrategy parent,
String basePropertyPath)
parent - AbstractPropertyAccessStrategy which will be used to
provide property accessbasePropertyPath - property path that will as a base when accessing
the parent AbstractPropertyAccessStrategy| Method Detail |
|---|
protected Object getUserMetadataFor(String propertyPath,
String key)
propertyPath and key. The
default implementation invokes getAllUserMetadataFor(String) and
uses the returned Map with the key parameter to find the
correlated value.
propertyPath - path of property relative to this beankey -
null if there is no custom metadata associated with the
property and key.protected Map getAllUserMetadataFor(String propertyPath)
propertyPath. The default implementation always
returns null.
propertyPath - path of property relative to this bean
null if there is no metadata for the property.protected abstract PropertyAccessor getPropertyAccessor()
public ValueModel getDomainObjectHolder()
MutablePropertyAccessStrategyValueModel used to access the domainObject.
getDomainObjectHolder in interface MutablePropertyAccessStrategyValueModel of the domainObject.
public ValueModel getPropertyValueModel(String propertyPath)
throws BeansException
MutablePropertyAccessStrategyValueModel to access the given property. Possibly
creating the valueModel if needed.
getPropertyValueModel in interface MutablePropertyAccessStrategypropertyPath - property to access.
ValueModel that handles the given property.
BeansExceptionprotected String getFullPropertyPath(String propertyPath)
protected String getPropertyName(String propertyPath)
protected String getParentPropertyPath(String propertyPath)
protected int getLastPropertySeparatorIndex(String propertyPath)
public abstract MutablePropertyAccessStrategy getPropertyAccessStrategyForPath(String propertyPath)
throws BeansException
MutablePropertyAccessStrategyMutablePropertyAccessStrategy for the given
property.
TODO check why this exists and where this is used.
getPropertyAccessStrategyForPath in interface MutablePropertyAccessStrategypropertyPath - property.
MutablePropertyAccessStrategy for the given
property.
BeansExceptionpublic abstract MutablePropertyAccessStrategy newPropertyAccessStrategy(ValueModel domainObjectHolder)
MutablePropertyAccessStrategyMutablePropertyAccessStrategy for the given
valueModel.
TODO check why this exists and where this is used.
newPropertyAccessStrategy in interface MutablePropertyAccessStrategydomainObjectHolder - a ValueModel containing the
domainObject.
MutablePropertyAccessStrategy.public Object getDomainObject()
PropertyAccessStrategy
getDomainObject in interface PropertyAccessStrategypublic PropertyMetadataAccessStrategy getMetadataAccessStrategy()
PropertyAccessStrategy
getMetadataAccessStrategy in interface PropertyAccessStrategy
public Object getPropertyValue(String propertyPath)
throws BeansException
PropertyAccessStrategy
getPropertyValue in interface PropertyAccessStrategypropertyPath - name of the property to get the value of
FatalBeanException - if there is no such property, if the property
isn't readable, or if the property getter throws an exception.
BeansExceptionprotected abstract void domainObjectChanged()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||