org.springframework.binding.support
Class ClassPropertyAccessStrategy

Show UML class diagram
java.lang.Object
  extended by org.springframework.binding.support.AbstractPropertyAccessStrategy
      extended by org.springframework.binding.support.ClassPropertyAccessStrategy
All Implemented Interfaces:
MutablePropertyAccessStrategy, PropertyAccessStrategy

public class ClassPropertyAccessStrategy
extends AbstractPropertyAccessStrategy

An implementation of MutablePropertyAccessStrategy that provides type-save access to data specified by a class. The data is stored in a backing map.

As this class delegates to a MapPropertyAccessor for property access, there is full support for nested properties and collection types.

Author:
Arne Limburg
See Also:
DefaultMemberPropertyAccessor

Constructor Summary
ClassPropertyAccessStrategy(Class targetClass)
          Creates a new instance of ClassPropertyAccessStrategy.
ClassPropertyAccessStrategy(ClassPropertyAccessStrategy parent, String basePropertyPath)
          Creates a child instance of ClassPropertyAccessStrategy that will delegate to its parent for property access.
ClassPropertyAccessStrategy(Object target)
          Creates a new instance of ClassPropertyAccessStrategy.
ClassPropertyAccessStrategy(ValueModel domainObjectHolder)
          Creates a new instance of ClassPropertyAccessStrategy.
ClassPropertyAccessStrategy(ValueModel domainObjectHolder, boolean fieldAccessEnabled)
          Creates a new instance of ClassPropertyAccessStrategy.
ClassPropertyAccessStrategy(ValueModel domainObjectHolder, boolean fieldAccessEnabled, boolean strictNullValueHandling)
          Creates a new instance of ClassPropertyAccessStrategy.
 
Method Summary
protected  void domainObjectChanged()
          Called when the domain object is changed.
protected  PropertyAccessor getPropertyAccessor()
           
 MutablePropertyAccessStrategy getPropertyAccessStrategyForPath(String propertyPath)
          Get a MutablePropertyAccessStrategy for the given property.
 MutablePropertyAccessStrategy newPropertyAccessStrategy(ValueModel domainObjectHolder)
          Return a new MutablePropertyAccessStrategy for the given valueModel.
 
Methods inherited from class org.springframework.binding.support.AbstractPropertyAccessStrategy
getAllUserMetadataFor, getDomainObject, getDomainObjectHolder, getFullPropertyPath, getLastPropertySeparatorIndex, getMetadataAccessStrategy, getParentPropertyPath, getPropertyName, getPropertyValue, getPropertyValueModel, getUserMetadataFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(Class targetClass)
Creates a new instance of ClassPropertyAccessStrategy.

Parameters:
targetClass - the target class

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(Object target)
Creates a new instance of ClassPropertyAccessStrategy.

Parameters:
target - the domain object

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(ValueModel domainObjectHolder)
Creates a new instance of ClassPropertyAccessStrategy.

Parameters:
domainObjectHolder - the value model containing the domain object

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(ValueModel domainObjectHolder,
                                   boolean fieldAccessEnabled)
Creates a new instance of ClassPropertyAccessStrategy.

Parameters:
domainObjectHolder - the value model containing the domain object
fieldAccessEnabled - whether the fields of the objects should be accessed directly where possible instead of using methods

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(ValueModel domainObjectHolder,
                                   boolean fieldAccessEnabled,
                                   boolean strictNullValueHandling)
Creates a new instance of ClassPropertyAccessStrategy.

Parameters:
domainObjectHolder - the value model containing the domain object
fieldAccessEnabled - whether the fields of the objects should be accessed directly where possible instead of using methods
strictNullValueHandling - whether a NullValueInNestedPathException should be thrown on nested null-values or null should be returned

ClassPropertyAccessStrategy

public ClassPropertyAccessStrategy(ClassPropertyAccessStrategy parent,
                                   String basePropertyPath)
Creates a child instance of ClassPropertyAccessStrategy that will delegate to its parent for property access.

Parameters:
parent - ClassPropertyAccessStrategy which will be used to provide property access
basePropertyPath - property path that will as a base when accessing the parent ClassPropertyAccessStrategy
Method Detail

getPropertyAccessor

protected PropertyAccessor getPropertyAccessor()
Specified by:
getPropertyAccessor in class AbstractPropertyAccessStrategy

getPropertyAccessStrategyForPath

public MutablePropertyAccessStrategy getPropertyAccessStrategyForPath(String propertyPath)
                                                               throws BeansException
Description copied from interface: MutablePropertyAccessStrategy
Get a MutablePropertyAccessStrategy for the given property. TODO check why this exists and where this is used.

Specified by:
getPropertyAccessStrategyForPath in interface MutablePropertyAccessStrategy
Specified by:
getPropertyAccessStrategyForPath in class AbstractPropertyAccessStrategy
Parameters:
propertyPath - property.
Returns:
MutablePropertyAccessStrategy for the given property.
Throws:
BeansException

newPropertyAccessStrategy

public MutablePropertyAccessStrategy newPropertyAccessStrategy(ValueModel domainObjectHolder)
Description copied from interface: MutablePropertyAccessStrategy
Return a new MutablePropertyAccessStrategy for the given valueModel. TODO check why this exists and where this is used.

Specified by:
newPropertyAccessStrategy in interface MutablePropertyAccessStrategy
Specified by:
newPropertyAccessStrategy in class AbstractPropertyAccessStrategy
Parameters:
domainObjectHolder - a ValueModel containing the domainObject.
Returns:
a newly created MutablePropertyAccessStrategy.

domainObjectChanged

protected void domainObjectChanged()
Description copied from class: AbstractPropertyAccessStrategy
Called when the domain object is changed.

Specified by:
domainObjectChanged in class AbstractPropertyAccessStrategy


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.