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:
EntityConfigurationwithout an actual entityEntityConfigurationwith an existing entityEntityAssociationwithout an actual entityEntityAssociationwith an actual entity
- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Method Summary
Modifier and TypeMethodDescriptioncom.foreach.across.modules.spring.security.actions.AllowableActionsGet the current entity being viewed as raw object.<T> TGet the current entity being viewed.If set the parent context will hold the parent entity this entity is associated to.booleanboolean
-
Method Details
-
getEntity
Object getEntity()Get the current entity being viewed as raw object.- Returns:
- entity or
nullif none present
-
getEntity
Get the current entity being viewed.- Type Parameters:
T- type the entity should have- Returns:
- entity or
nullif 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
EntityMessagesfor common views
-
getPropertyRegistry
EntityPropertyRegistry getPropertyRegistry()- Returns:
- the
EntityPropertyRegistrythat 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:
trueif an existing entity is present
-
isForAssociation
boolean isForAssociation()- Returns:
- true if an association is being viewed, if so both
getParentContext()andgetEntityAssociation()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
nullifisForAssociation()returnsfalse
-