|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.axonframework.common.property.PropertyAccessStrategy
public abstract class PropertyAccessStrategy
Abstract Strategy that provides access to all PropertyAccessStrategy implementations.
Application developers may provide custom PropertyAccessStrategy implementations using the ServiceLoader mechanism. To do so, place a file calledorg.axonframework.common.property.PropertyAccessStrategy
in the META-INF/services folder. In this file, place the fully qualified class names of all available
implementations.
The factory implementations must be public, non-abstract, have a default public constructor and extend the
PropertyAccessStrategy class.
Note that this class is not considered public API and may undergo incompatible changes between versions.
ServiceLoader,
ServiceLoader.load(Class)| Constructor Summary | |
|---|---|
PropertyAccessStrategy()
|
|
| Method Summary | ||
|---|---|---|
int |
compareTo(PropertyAccessStrategy o)
|
|
protected abstract int |
getPriority()
The priority of this strategy. |
|
static
|
getProperty(Class<T> targetClass,
String propertyName)
Iterates over all known PropertyAccessStrategy implementations to create a Property instance for the
given parameters. |
|
protected abstract
|
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. |
|
static void |
register(PropertyAccessStrategy strategy)
Registers a PropertyAccessStrategy implementation at runtime. |
|
static void |
unregister(PropertyAccessStrategy strategy)
Removes all strategies registered using the register(PropertyAccessStrategy) method. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyAccessStrategy()
| Method Detail |
|---|
public static void register(PropertyAccessStrategy strategy)
strategy - implementation to registerpublic static void unregister(PropertyAccessStrategy strategy)
register(PropertyAccessStrategy) method.
strategy - The strategy instance to unregister
public static <T> Property<T> getProperty(Class<T> targetClass,
String propertyName)
Property instance for the
given parameters. Strategies are invoked in the order they are found on the classpath. The first to provide a
suitable Property instance will be used.
T - Thy type defining the propertytargetClass - class that contains propertypropertyName - name of the property to create propertyReader for
Property, or null if none is foundpublic final int compareTo(PropertyAccessStrategy o)
compareTo in interface Comparable<PropertyAccessStrategy>protected abstract int getPriority()
Integer.MAX_VALUE being evaluated first
protected abstract <T> Property<T> propertyFor(Class<T> targetClass,
String property)
property, defined in given
targetClass, or null if no such property is found on the class.
T - The type of class on which to find the propertytargetClass - The class on which to find the propertyproperty - The name of the property to find
null if property could not
be found.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||