Class AnnotatedAggregateMetaModelFactory
java.lang.Object
org.axonframework.modelling.command.inspection.AnnotatedAggregateMetaModelFactory
- All Implemented Interfaces:
AggregateMetaModelFactory
AggregateMetaModelFactory implementation that uses annotations on the target aggregate's members to build up the
meta-model of the aggregate.
- Since:
- 3.1
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an instance which uses the default, classpath based, ParameterResolverFactory to detect parameters for annotated handlers.AnnotatedAggregateMetaModelFactory(ParameterResolverFactory parameterResolverFactory) Initializes an instance which uses the givenparameterResolverFactoryto detect parameters for annotated handlers.AnnotatedAggregateMetaModelFactory(ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Initializes an instance which uses the givenparameterResolverFactoryto detect parameters for annotated handlers andhandlerDefinitionto create concrete handlers. -
Method Summary
Modifier and TypeMethodDescription<T> org.axonframework.modelling.command.inspection.AnnotatedAggregateMetaModelFactory.AnnotatedAggregateModel<T> createModel(Class<? extends T> aggregateType, Set<Class<? extends T>> subtypes) Create an Aggregate meta model for the givenaggregateTypeand providedsubtypes.static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType) Shorthand to create a factory instance and inspect the model for the givenaggregateType.static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, Set<Class<? extends T>> subtypes) Shorthand to create a factory instance and inspect the model for the givenaggregateTypeand itssubtypes.static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory) Shorthand to create a factory instance and inspect the model for the givenaggregateType, using givenparameterResolverFactoryto resolve parameter values for annotated handlers.static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Shorthand to create a factory instance and inspect the model for the givenaggregateType, using givenparameterResolverFactoryto resolve parameter values for annotated handlers andhandlerDefinitionto create concrete handlers.static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition, Set<Class<? extends T>> subtypes) Shorthand to create a factory instance and inspect the model for the givenaggregateTypeand itssubytpes, using givenparameterResolverFactoryto resolve parameter values for annotated handlers andhandlerDefinitionto create concrete handlers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.modelling.command.inspection.AggregateMetaModelFactory
createModel
-
Constructor Details
-
AnnotatedAggregateMetaModelFactory
public AnnotatedAggregateMetaModelFactory()Initializes an instance which uses the default, classpath based, ParameterResolverFactory to detect parameters for annotated handlers. -
AnnotatedAggregateMetaModelFactory
Initializes an instance which uses the givenparameterResolverFactoryto detect parameters for annotated handlers.- Parameters:
parameterResolverFactory- to resolve parameter values of annotated handlers with
-
AnnotatedAggregateMetaModelFactory
public AnnotatedAggregateMetaModelFactory(ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Initializes an instance which uses the givenparameterResolverFactoryto detect parameters for annotated handlers andhandlerDefinitionto create concrete handlers.- Parameters:
parameterResolverFactory- to resolve parameter values of annotated handlers withhandlerDefinition- The handler definition used to create concrete handlers
-
-
Method Details
-
inspectAggregate
Shorthand to create a factory instance and inspect the model for the givenaggregateType.- Type Parameters:
T- The type of aggregate described in the model- Parameters:
aggregateType- The class of the aggregate to create the model for- Returns:
- The model describing the structure of the aggregate
-
inspectAggregate
public static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, Set<Class<? extends T>> subtypes) Shorthand to create a factory instance and inspect the model for the givenaggregateTypeand itssubtypes.- Type Parameters:
T- The type of aggregate described in the model- Parameters:
aggregateType- The class of the aggregate to create the model forsubtypes- Subtypes of this aggregate class- Returns:
- The model describing the structure of the aggregate
-
inspectAggregate
public static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory) Shorthand to create a factory instance and inspect the model for the givenaggregateType, using givenparameterResolverFactoryto resolve parameter values for annotated handlers.- Type Parameters:
T- the type of aggregate described in the model- Parameters:
aggregateType- the class of the aggregate to create the model forparameterResolverFactory- to resolve parameter values of annotated handlers with- Returns:
- the model describing the structure of the aggregate
-
inspectAggregate
public static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Shorthand to create a factory instance and inspect the model for the givenaggregateType, using givenparameterResolverFactoryto resolve parameter values for annotated handlers andhandlerDefinitionto create concrete handlers.- Type Parameters:
T- The type of aggregate described in the model- Parameters:
aggregateType- The class of the aggregate to create the model forparameterResolverFactory- to resolve parameter values of annotated handlers withhandlerDefinition- The handler definition used to create concrete handlers- Returns:
- The model describing the structure of the aggregate
-
inspectAggregate
public static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition, Set<Class<? extends T>> subtypes) Shorthand to create a factory instance and inspect the model for the givenaggregateTypeand itssubytpes, using givenparameterResolverFactoryto resolve parameter values for annotated handlers andhandlerDefinitionto create concrete handlers.- Type Parameters:
T- The type of aggregate described in the model- Parameters:
aggregateType- The class of the aggregate to create the model forparameterResolverFactory- to resolve parameter values of annotated handlers withhandlerDefinition- The handler definition used to create concrete handlerssubtypes- Subtypes of this aggregate class- Returns:
- The model describing the structure of the aggregate
-
createModel
public <T> org.axonframework.modelling.command.inspection.AnnotatedAggregateMetaModelFactory.AnnotatedAggregateModel<T> createModel(Class<? extends T> aggregateType, Set<Class<? extends T>> subtypes) Description copied from interface:AggregateMetaModelFactoryCreate an Aggregate meta model for the givenaggregateTypeand providedsubtypes. The meta model will inspect the capabilities and characteristics of the givenaggregateTypeand itssubtypes.- Specified by:
createModelin interfaceAggregateMetaModelFactory- Type Parameters:
T- The Aggregate type- Parameters:
aggregateType- The Aggregate class to be inspectedsubtypes- Subtypes of this Aggregate class- Returns:
- Model describing the capabilities and characteristics of the inspected Aggregate class and its subtypes
-