Class DefaultEntityViewContext
java.lang.Object
com.foreach.across.modules.entity.views.context.DefaultEntityViewContext
- All Implemented Interfaces:
ConfigurableEntityViewContext,EntityViewContext
@Component
@Exposed
@Scope(scopeName="request",
proxyMode=INTERFACES)
public class DefaultEntityViewContext
extends Object
implements ConfigurableEntityViewContext
Default implementation of
ConfigurableEntityViewContext.
Data bean that is also registered as a request-scoped proxy.- Since:
- 2.0.0
- Author:
- Arne Vandamme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancom.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.inthashCode()booleanbooleanvoidsetAllowableActions(com.foreach.across.modules.spring.security.actions.AllowableActions allowableActions) voidvoidsetEntityAssociation(EntityAssociation entityAssociation) voidsetEntityConfiguration(EntityConfiguration entityConfiguration) voidsetEntityMessages(EntityMessages entityMessages) voidsetEntityModel(EntityModel entityModel) voidsetLinkBuilder(EntityViewLinkBuilder linkBuilder) voidsetMessageCodeResolver(EntityMessageCodeResolver messageCodeResolver) voidsetParentContext(EntityViewContext parentContext) voidsetPropertyRegistry(EntityPropertyRegistry propertyRegistry) toString()
-
Constructor Details
-
DefaultEntityViewContext
public DefaultEntityViewContext()
-
-
Method Details
-
setEntityConfiguration
- Specified by:
setEntityConfigurationin interfaceConfigurableEntityViewContext
-
setEntity
- Specified by:
setEntityin interfaceConfigurableEntityViewContext
-
getEntityLabel
- Specified by:
getEntityLabelin interfaceEntityViewContext- Returns:
- the label for the current entity being viewed
-
getEntity
Description copied from interface:EntityViewContextGet the current entity being viewed.- Specified by:
getEntityin interfaceEntityViewContext- Type Parameters:
T- type the entity should have- Returns:
- entity or
nullif none present
-
holdsEntity
public boolean holdsEntity()- Specified by:
holdsEntityin interfaceEntityViewContext- Returns:
trueif an existing entity is present
-
isForAssociation
public boolean isForAssociation()- Specified by:
isForAssociationin interfaceEntityViewContext- Returns:
- true if an association is being viewed, if so both
EntityViewContext.getParentContext()andEntityViewContext.getEntityAssociation()should return values
-
setAllowableActions
public void setAllowableActions(com.foreach.across.modules.spring.security.actions.AllowableActions allowableActions) - Specified by:
setAllowableActionsin interfaceConfigurableEntityViewContext
-
getAllowableActions
public com.foreach.across.modules.spring.security.actions.AllowableActions getAllowableActions()- Specified by:
getAllowableActionsin interfaceEntityViewContext- 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
-
toString
-
getEntity
Description copied from interface:EntityViewContextGet the current entity being viewed as raw object.- Specified by:
getEntityin interfaceEntityViewContext- Returns:
- entity or
nullif none present
-
getEntityConfiguration
- Specified by:
getEntityConfigurationin interfaceEntityViewContext- Returns:
- the current entity configuration being viewed
-
getLinkBuilder
- Specified by:
getLinkBuilderin interfaceEntityViewContext- Returns:
- link builder for the entity
-
getMessageCodeResolver
- Specified by:
getMessageCodeResolverin interfaceEntityViewContext- Returns:
- message code resolver for the current entity
-
getEntityMessages
- Specified by:
getEntityMessagesin interfaceEntityViewContext- Returns:
- generic
EntityMessagesfor common views
-
getEntityAssociation
- Specified by:
getEntityAssociationin interfaceEntityViewContext- Returns:
- association that is being viewed
-
getParentContext
Description copied from interface:EntityViewContextIf set the parent context will hold the parent entity this entity is associated to.- Specified by:
getParentContextin interfaceEntityViewContext- Returns:
- parent context, can be
nullifEntityViewContext.isForAssociation()returnsfalse
-
getEntityModel
- Specified by:
getEntityModelin interfaceEntityViewContext- Returns:
- the model to use for the current entity
-
getPropertyRegistry
- Specified by:
getPropertyRegistryin interfaceEntityViewContext- Returns:
- the
EntityPropertyRegistrythat should be used for this view
-
setLinkBuilder
- Specified by:
setLinkBuilderin interfaceConfigurableEntityViewContext
-
setMessageCodeResolver
- Specified by:
setMessageCodeResolverin interfaceConfigurableEntityViewContext
-
setEntityMessages
- Specified by:
setEntityMessagesin interfaceConfigurableEntityViewContext
-
setEntityAssociation
- Specified by:
setEntityAssociationin interfaceConfigurableEntityViewContext
-
setParentContext
- Specified by:
setParentContextin interfaceConfigurableEntityViewContext
-
setEntityModel
- Specified by:
setEntityModelin interfaceConfigurableEntityViewContext
-
setPropertyRegistry
- Specified by:
setPropertyRegistryin interfaceConfigurableEntityViewContext
-
equals
-
canEqual
-
hashCode
public int hashCode()
-