Class EntityViewElementBatch<T>
java.lang.Object
com.foreach.across.core.support.AttributeSupport
com.foreach.across.core.support.AttributeOverridingSupport
com.foreach.across.modules.web.ui.DefaultViewElementBuilderContext
com.foreach.across.modules.entity.views.helpers.EntityViewElementBatch<T>
- All Implemented Interfaces:
com.foreach.across.core.support.ReadableAttributes,com.foreach.across.core.support.WritableAttributes,com.foreach.across.modules.web.support.LocalizedTextResolver,com.foreach.across.modules.web.ui.ViewElementBuilderContext,org.springframework.core.AttributeAccessor
@NotThreadSafe
public class EntityViewElementBatch<T>
extends com.foreach.across.modules.web.ui.DefaultViewElementBuilderContext
Helper to quickly generate
ViewElement instances
for a number of properties of a certain EntityPropertyRegistry.
The properties are determined by the selector assigned through setPropertySelector(EntityPropertySelector).
Behind the scenes a getPropertiesBinder() will be used for fetching the values.
Note: this class is not thread safe.
- Author:
- Arne Vandamme
-
Field Summary
Fields inherited from class com.foreach.across.modules.web.ui.DefaultViewElementBuilderContext
FALLBACK_LINK_BUILDER, FALLBACK_MESSAGE_SOURCE, FALLBACK_TEXT_RESOLVER -
Constructor Summary
ConstructorsConstructorDescriptionEntityViewElementBatch(EntityViewElementBuilderService viewElementBuilderService) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Generates the final elements.build(com.foreach.across.modules.web.ui.ViewElementBuilderContext parentBuilderContext) Generates the final elements using the specified builder context as parent.protected com.foreach.across.modules.web.ui.ViewElementBuilderContextvoidsetBuilderHints(@NonNull Map<String, Object> builderHints) Set a map of property builder hints.voidSet the entity that should be used for the next build.voidsetParentViewElementBuilderContext(com.foreach.across.modules.web.ui.ViewElementBuilderContext viewElementBuilderContext) voidsetPropertyRegistry(EntityPropertyRegistry propertyRegistry) voidsetPropertySelector(EntityPropertySelector propertySelector) voidsetViewElementMode(ViewElementMode viewElementMode) Methods inherited from class com.foreach.across.modules.web.ui.DefaultViewElementBuilderContext
buildLink, getLocalizedTextResolver, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessageSource, getWebAppLinkBuilder, getWebResourceRegistry, registerMissingDefaultAttributes, resolveText, resolveText, resolveText, resolveText, setLocalizedTextResolver, setMessageSource, setWebAppLinkBuilder, setWebResourceRegistryMethods inherited from class com.foreach.across.core.support.AttributeOverridingSupport
attributeMap, attributeNames, findAttribute, findAttribute, findAttribute, getAttribute, getAttribute, getAttribute, hasAttribute, hasAttribute, setParentMethods inherited from class com.foreach.across.core.support.AttributeSupport
removeAttribute, removeAttribute, setAttribute, setAttribute, setAttributesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, computeAttribute, getAttribute, hasAttribute, removeAttribute, setAttributeMethods inherited from interface com.foreach.across.core.support.ReadableAttributes
attributeMap, attributeNames, getAttribute, getAttribute, getAttribute, hasAttribute, hasAttributeMethods inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilderContext
findAttribute, findAttribute, findAttribute, withAttributeOverride, withAttributeOverrideMethods inherited from interface com.foreach.across.core.support.WritableAttributes
removeAttribute, setAttribute, setAttributes
-
Constructor Details
-
EntityViewElementBatch
-
-
Method Details
-
setPropertyRegistry
-
setParentViewElementBuilderContext
public void setParentViewElementBuilderContext(com.foreach.across.modules.web.ui.ViewElementBuilderContext viewElementBuilderContext) -
getParent
protected com.foreach.across.modules.web.ui.ViewElementBuilderContext getParent()- Overrides:
getParentin classcom.foreach.across.core.support.AttributeOverridingSupport
-
setPropertySelector
-
setViewElementMode
-
setEntity
Set the entity that should be used for the next build.- Parameters:
entity- instance
-
setBuilderHints
Set a map of property builder hints. The keys are the property names, the value should be one of the following:ViewElementMode: for which specific mode the builder should be retrievedString: which element type should be generated for the propertyViewElementBuilder: element builder that should be used for building the elementViewElement: fixed element that should be returned
- Parameters:
builderHints- map instance, should not be null
-
build
Generates the final elements.- Returns:
- map of property name/ element
-
build
public Map<String,com.foreach.across.modules.web.ui.ViewElement> build(com.foreach.across.modules.web.ui.ViewElementBuilderContext parentBuilderContext) Generates the final elements using the specified builder context as parent. This will override the default parent context set withsetParentViewElementBuilderContext(ViewElementBuilderContext).- Parameters:
parentBuilderContext- to use- Returns:
- map of property name/element
-
getPropertiesBinder
-