Class IteratorViewElementBuilderContext<ITEM>
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.web.ui.IteratorViewElementBuilderContext<ITEM>
- All Implemented Interfaces:
ReadableAttributes,WritableAttributes,LocalizedTextResolver,IteratorItemStats<ITEM>,ViewElementBuilderContext,org.springframework.core.AttributeAccessor
public class IteratorViewElementBuilderContext<ITEM>
extends DefaultViewElementBuilderContext
implements ViewElementBuilderContext, IteratorItemStats<ITEM>
Wrapping
ViewElementBuilderContext that is used by a ViewElementGenerator and provides
access to the item being generated and the possible iteration context.
This context optionally takes a parent context. All attributes from the parent context will be inherited
and can be masked or replaced in the iterator context. This context does not automatically register
default attributes (see DefaultViewElementBuilderContext.registerMissingDefaultAttributes(ViewElementBuilderContext)).
- 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
ConstructorsConstructorDescriptionIteratorViewElementBuilderContext(@NonNull IteratorItemStats<ITEM> itemStats) -
Method Summary
Modifier and TypeMethodDescriptionintgetIndex()getItem()booleanhasNext()booleanbooleanisFirst()booleanisLast()voidsetParentContext(ViewElementBuilderContext parentContext) Set the parent context that this iteration context wraps around.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, getParent, 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.modules.web.support.LocalizedTextResolver
resolveText, resolveText, resolveText, resolveTextMethods 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
buildLink, findAttribute, findAttribute, findAttribute, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, withAttributeOverride, withAttributeOverrideMethods inherited from interface com.foreach.across.core.support.WritableAttributes
removeAttribute, setAttribute, setAttributes
-
Constructor Details
-
IteratorViewElementBuilderContext
-
-
Method Details
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPreviousin interfaceIteratorItemStats<ITEM>- Returns:
- True if previous items have been generated.
-
isFirst
public boolean isFirst()- Specified by:
isFirstin interfaceIteratorItemStats<ITEM>- Returns:
- True if this item is the first one being generated.
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIteratorItemStats<ITEM>- Returns:
- True if another item needs generating.
-
isLast
public boolean isLast()- Specified by:
isLastin interfaceIteratorItemStats<ITEM>- Returns:
- True if this item is the last one being generated.
-
getItem
- Specified by:
getItemin interfaceIteratorItemStats<ITEM>- Returns:
- the curren iteration item
-
getIndex
public int getIndex()- Specified by:
getIndexin interfaceIteratorItemStats<ITEM>- Returns:
- Index of the item in the collection.
-
getParentContext
- Returns:
- parent context that attributes are inherited from
-
setParentContext
Set the parent context that this iteration context wraps around. All attributes from the parent context will be available in the iteration scope.- Parameters:
parentContext- to inherit the attributes from
-