Class AnnotatedAggregateMetaModelFactory

java.lang.Object
org.axonframework.modelling.command.inspection.AnnotatedAggregateMetaModelFactory
All Implemented Interfaces:
AggregateMetaModelFactory

public class AnnotatedAggregateMetaModelFactory extends Object implements 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 Details

    • AnnotatedAggregateMetaModelFactory

      public AnnotatedAggregateMetaModelFactory()
      Initializes an instance which uses the default, classpath based, ParameterResolverFactory to detect parameters for annotated handlers.
    • AnnotatedAggregateMetaModelFactory

      public AnnotatedAggregateMetaModelFactory(ParameterResolverFactory parameterResolverFactory)
      Initializes an instance which uses the given parameterResolverFactory to 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 given parameterResolverFactory to detect parameters for annotated handlers and handlerDefinition to create concrete handlers.
      Parameters:
      parameterResolverFactory - to resolve parameter values of annotated handlers with
      handlerDefinition - The handler definition used to create concrete handlers
  • Method Details

    • inspectAggregate

      public static <T> AggregateModel<T> inspectAggregate(Class<T> aggregateType)
      Shorthand to create a factory instance and inspect the model for the given aggregateType.
      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 given aggregateType and its subtypes.
      Type Parameters:
      T - The type of aggregate described in the model
      Parameters:
      aggregateType - The class of the aggregate to create the model for
      subtypes - 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 given aggregateType, using given parameterResolverFactory to 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 for
      parameterResolverFactory - 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 given aggregateType, using given parameterResolverFactory to resolve parameter values for annotated handlers and handlerDefinition to 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 for
      parameterResolverFactory - to resolve parameter values of annotated handlers with
      handlerDefinition - 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 given aggregateType and its subytpes, using given parameterResolverFactory to resolve parameter values for annotated handlers and handlerDefinition to 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 for
      parameterResolverFactory - to resolve parameter values of annotated handlers with
      handlerDefinition - The handler definition used to create concrete handlers
      subtypes - 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: AggregateMetaModelFactory
      Create an Aggregate meta model for the given aggregateType and provided subtypes. The meta model will inspect the capabilities and characteristics of the given aggregateType and its subtypes.
      Specified by:
      createModel in interface AggregateMetaModelFactory
      Type Parameters:
      T - The Aggregate type
      Parameters:
      aggregateType - The Aggregate class to be inspected
      subtypes - Subtypes of this Aggregate class
      Returns:
      Model describing the capabilities and characteristics of the inspected Aggregate class and its subtypes