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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
PostProcessor interface for a single configuration. -
Constructor Summary
ConstructorDescriptionDefaultEntityConfigurationProvider
(org.springframework.context.MessageSource messageSource, EntityPropertyRegistryProvider propertyRegistryProvider) -
Method Summary
Modifier and TypeMethodDescription<T> MutableEntityConfiguration<T>
Create a new entity configuration for the given entity type.<T> MutableEntityConfiguration<T>
Create a new entity configuration for the given entity type with the specific name.void
setPostProcessors
(Collection<DefaultEntityConfigurationProvider.PostProcessor> postProcessors)
-
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
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 interfaceEntityConfigurationProvider
- 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 theEntityPropertyRegistryProvider
. 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 interfaceEntityConfigurationProvider
- Type Parameters:
T
- type- Parameters:
name
- of the configurationentityType
- to create the configuration forregisterForClass
- true if the property registry should be the main registry for that type- Returns:
- pre-configured entity configuration
-