public abstract class PropertyAccessStrategy extends Object implements Comparable<PropertyAccessStrategy>
org.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 and Description |
|---|
PropertyAccessStrategy() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PropertyAccessStrategy o) |
protected abstract int |
getPriority()
The priority of this strategy.
|
static <T> Property<T> |
getProperty(Class<? extends T> targetClass,
String propertyName)
Iterates over all known PropertyAccessStrategy implementations to create a
Property instance for the
given parameters. |
protected abstract <T> Property<T> |
propertyFor(Class<? extends 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. |
public static void register(PropertyAccessStrategy strategy)
strategy - implementation to registerpublic static void unregister(PropertyAccessStrategy strategy)
register(PropertyAccessStrategy) method.strategy - The strategy instance to unregisterpublic static <T> Property<T> getProperty(Class<? extends 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 forProperty, 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 firstprotected abstract <T> Property<T> propertyFor(Class<? extends 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 findnull if property could not
be found.Copyright © 2010–2018. All rights reserved.