org.axonframework.common.property
Class AbstractMethodPropertyAccessStrategy

java.lang.Object
  extended by org.axonframework.common.property.PropertyAccessStrategy
      extended by org.axonframework.common.property.AbstractMethodPropertyAccessStrategy
All Implemented Interfaces:
Comparable<PropertyAccessStrategy>
Direct Known Subclasses:
BeanPropertyAccessStrategy, UniformPropertyAccessStrategy

public abstract class AbstractMethodPropertyAccessStrategy
extends PropertyAccessStrategy

Abstract implementation of the PropertyAccessStrategy that uses a no-arg, public method to access the property value. The name of the method can be derived from the name of the property.

Since:
2.0
Author:
Maxim Fedorov, Allard Buijze

Constructor Summary
AbstractMethodPropertyAccessStrategy()
           
 
Method Summary
protected abstract  String getterName(String property)
          Returns the name of the method that is used to access the property.
<T> Property<T>
propertyFor(Class<T> targetClass, String property)
          Returns a Property instance for the given property, defined in given targetClass, or null if no such property is found on the class.
 
Methods inherited from class org.axonframework.common.property.PropertyAccessStrategy
compareTo, getPriority, getProperty, register, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMethodPropertyAccessStrategy

public AbstractMethodPropertyAccessStrategy()
Method Detail

propertyFor

public <T> Property<T> propertyFor(Class<T> targetClass,
                                   String property)
Description copied from class: PropertyAccessStrategy
Returns a Property instance for the given property, defined in given targetClass, or null if no such property is found on the class.

Specified by:
propertyFor in class PropertyAccessStrategy
Type Parameters:
T - The type of class on which to find the property
Parameters:
targetClass - The class on which to find the property
property - The name of the property to find
Returns:
the Property instance providing access to the property value, or null if property could not be found.

getterName

protected abstract String getterName(String property)
Returns the name of the method that is used to access the property.

Parameters:
property - The property to access
Returns:
the name of the method use as accessor


Copyright © 2010-2016. All Rights Reserved.