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
ConstructorDescriptionIteratorViewElementBuilderContext
(@NonNull IteratorItemStats<ITEM> itemStats) -
Method Summary
Modifier and TypeMethodDescriptionint
getIndex()
getItem()
boolean
hasNext()
boolean
boolean
isFirst()
boolean
isLast()
void
setParentContext
(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, setWebResourceRegistry
Methods inherited from class com.foreach.across.core.support.AttributeOverridingSupport
attributeMap, attributeNames, findAttribute, findAttribute, findAttribute, getAttribute, getAttribute, getAttribute, getParent, hasAttribute, hasAttribute, setParent
Methods inherited from class com.foreach.across.core.support.AttributeSupport
removeAttribute, removeAttribute, setAttribute, setAttribute, setAttributes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.AttributeAccessor
attributeNames, computeAttribute, getAttribute, hasAttribute, removeAttribute, setAttribute
Methods inherited from interface com.foreach.across.modules.web.support.LocalizedTextResolver
resolveText, resolveText, resolveText, resolveText
Methods inherited from interface com.foreach.across.core.support.ReadableAttributes
attributeMap, attributeNames, getAttribute, getAttribute, getAttribute, hasAttribute, hasAttribute
Methods inherited from interface com.foreach.across.modules.web.ui.ViewElementBuilderContext
buildLink, findAttribute, findAttribute, findAttribute, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, getMessage, withAttributeOverride, withAttributeOverride
Methods inherited from interface com.foreach.across.core.support.WritableAttributes
removeAttribute, setAttribute, setAttributes
-
Constructor Details
-
IteratorViewElementBuilderContext
-
-
Method Details
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceIteratorItemStats<ITEM>
- Returns:
- True if previous items have been generated.
-
isFirst
public boolean isFirst()- Specified by:
isFirst
in interfaceIteratorItemStats<ITEM>
- Returns:
- True if this item is the first one being generated.
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIteratorItemStats<ITEM>
- Returns:
- True if another item needs generating.
-
isLast
public boolean isLast()- Specified by:
isLast
in interfaceIteratorItemStats<ITEM>
- Returns:
- True if this item is the last one being generated.
-
getItem
- Specified by:
getItem
in interfaceIteratorItemStats<ITEM>
- Returns:
- the curren iteration item
-
getIndex
public int getIndex()- Specified by:
getIndex
in 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
-