Class EntityViewContextLoader

java.lang.Object
com.foreach.across.modules.entity.views.context.EntityViewContextLoader

@Service public class EntityViewContextLoader extends Object
Responsible for loading the required properties for a valid ConfigurableEntityViewContext, based on a either EntityConfiguration.
Since:
2.0.0
Author:
Arne Vandamme
  • Constructor Details

    • EntityViewContextLoader

      public EntityViewContextLoader()
  • Method Details

    • loadForEntity

      public void loadForEntity(ConfigurableEntityViewContext context, @NonNull @NonNull Object entity)
      Load the properties of context based on the entity configuration available for the entity. Will throw an exception if the entity is null.
      Parameters:
      context - to set the properties on
      entity - to use for loading
    • loadForEntityConfiguration

      public void loadForEntityConfiguration(ConfigurableEntityViewContext context, @NonNull @NonNull String entityName)
      Load the properties of context 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 on
      entityName - name of the EntityConfiguration to get the values from
    • loadForEntityConfiguration

      public void loadForEntityConfiguration(ConfigurableEntityViewContext context, @NonNull @NonNull EntityConfiguration<?> entityConfiguration)
      Load the properties of context based on the entity configuration value. Will throw an exception if the entity configuration is null.
      Parameters:
      context - to set the properties on
      entityConfiguration - to get the values from