Class EntityViewContextLoader
java.lang.Object
com.foreach.across.modules.entity.views.context.EntityViewContextLoader
Responsible for loading the required properties for a valid
ConfigurableEntityViewContext
,
based on a either EntityConfiguration
.- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
loadForEntity
(ConfigurableEntityViewContext context, @NonNull Object entity) Load the properties ofcontext
based on the entity configuration available for the entity.void
loadForEntityConfiguration
(ConfigurableEntityViewContext context, @NonNull EntityConfiguration<?> entityConfiguration) Load the properties ofcontext
based on the entity configuration value.void
loadForEntityConfiguration
(ConfigurableEntityViewContext context, @NonNull String entityName) Load the properties ofcontext
based on the entity configuration with the given name.
-
Constructor Details
-
EntityViewContextLoader
public EntityViewContextLoader()
-
-
Method Details
-
loadForEntity
Load the properties ofcontext
based on the entity configuration available for the entity. Will throw an exception if the entity is null.- Parameters:
context
- to set the properties onentity
- to use for loading
-
loadForEntityConfiguration
public void loadForEntityConfiguration(ConfigurableEntityViewContext context, @NonNull @NonNull String entityName) Load the properties ofcontext
based on the entity configuration with the given name. Will throw an exception if either name or the resulting entity configuration is null.- Parameters:
context
- to set the properties onentityName
- name of theEntityConfiguration
to get the values from
-
loadForEntityConfiguration
public void loadForEntityConfiguration(ConfigurableEntityViewContext context, @NonNull @NonNull EntityConfiguration<?> entityConfiguration) Load the properties ofcontext
based on the entity configuration value. Will throw an exception if the entity configuration is null.- Parameters:
context
- to set the properties onentityConfiguration
- to get the values from
-