Interface EntityViewContext

All Known Subinterfaces:
ConfigurableEntityViewContext
All Known Implementing Classes:
DefaultEntityViewContext

public interface EntityViewContext
Holds the properties of a current entity or entity configuration being viewed. There are 4 distinct possibilities:
Since:
2.0.0
Author:
Arne Vandamme
  • Method Details

    • getEntity

      Object getEntity()
      Get the current entity being viewed as raw object.
      Returns:
      entity or null if none present
    • getEntity

      <T> T getEntity(Class<T> entityType)
      Get the current entity being viewed.
      Type Parameters:
      T - type the entity should have
      Returns:
      entity or null if none present
    • getEntityLabel

      String getEntityLabel()
      Returns:
      the label for the current entity being viewed
    • getEntityConfiguration

      EntityConfiguration getEntityConfiguration()
      Returns:
      the current entity configuration being viewed
    • getEntityModel

      EntityModel getEntityModel()
      Returns:
      the model to use for the current entity
    • getLinkBuilder

      EntityViewLinkBuilder getLinkBuilder()
      Returns:
      link builder for the entity
    • getMessageCodeResolver

      EntityMessageCodeResolver getMessageCodeResolver()
      Returns:
      message code resolver for the current entity
    • getEntityMessages

      EntityMessages getEntityMessages()
      Returns:
      generic EntityMessages for common views
    • getPropertyRegistry

      EntityPropertyRegistry getPropertyRegistry()
      Returns:
      the EntityPropertyRegistry that should be used for this view
    • getAllowableActions

      com.foreach.across.modules.spring.security.actions.AllowableActions getAllowableActions()
      Returns:
      the allowable actions for this entity view, will either return the allowable actions for the specific entity, or for the general entity configuration if no entity is set
    • holdsEntity

      boolean holdsEntity()
      Returns:
      true if an existing entity is present
    • isForAssociation

      boolean isForAssociation()
      Returns:
      true if an association is being viewed, if so both getParentContext() and getEntityAssociation() should return values
    • getEntityAssociation

      EntityAssociation getEntityAssociation()
      Returns:
      association that is being viewed
    • getParentContext

      EntityViewContext getParentContext()
      If set the parent context will hold the parent entity this entity is associated to.
      Returns:
      parent context, can be null if isForAssociation() returns false