Class DefaultEntityConfigurationProvider

java.lang.Object
com.foreach.across.modules.entity.registry.DefaultEntityConfigurationProvider
All Implemented Interfaces:
EntityConfigurationProvider

@Service public class DefaultEntityConfigurationProvider extends Object implements EntityConfigurationProvider
Default factory for creating a new MutableEntityConfiguration that allows a number of DefaultEntityConfigurationProvider.PostProcessor beans to be defined. These will be run in order and applied to any newly created configuration, before it is returned.
Since:
2.0.0
Author:
Arne Vandamme
  • Constructor Details

    • DefaultEntityConfigurationProvider

      @Autowired public DefaultEntityConfigurationProvider(org.springframework.context.MessageSource messageSource, EntityPropertyRegistryProvider propertyRegistryProvider)
  • Method Details

    • setPostProcessors

      @RefreshableCollection(includeModuleInternals=true, incremental=true) public void setPostProcessors(Collection<DefaultEntityConfigurationProvider.PostProcessor> postProcessors)
    • create

      public <T> MutableEntityConfiguration<T> create(@NonNull @NonNull Class<T> entityType)
      Description copied from interface: EntityConfigurationProvider
      Create a new entity configuration for the given entity type. Assumes this is the single configuration for that class and will register the property registry as the main registry for that class.
      Specified by:
      create in interface EntityConfigurationProvider
      Type Parameters:
      T - type
      Parameters:
      entityType - to create the configuration for
      Returns:
      pre-configured entity configuration
    • create

      public <T> MutableEntityConfiguration<T> create(@NonNull @NonNull String name, @NonNull @NonNull Class<? extends T> entityType, boolean registerForClass)
      Description copied from interface: EntityConfigurationProvider
      Create a new entity configuration for the given entity type with the specific name.

      The registerForClass parameter determines if the property registry of the class should be the main registry in the EntityPropertyRegistryProvider. If that is the case, nested properties on this type will be resolved against this configuration. If you're expecting to have only one entity configuration using this entity type, then you most likely want to register this configuration for that type.

      Specified by:
      create in interface EntityConfigurationProvider
      Type Parameters:
      T - type
      Parameters:
      name - of the configuration
      entityType - to create the configuration for
      registerForClass - true if the property registry should be the main registry for that type
      Returns:
      pre-configured entity configuration