org.apache.velocity.runtime.directive
Class Foreach
- Cloneable, DirectiveConstants
Foreach directive used for moving through arrays,
or objects that provide an Iterator.
Version:
- Jason van Zyl
- Geir Magnusson Jr.
private static int | INFO_ARRAY - Flag to indicate that the list object being used
in an array.
|
private static int | INFO_COLLECTION - Flag to indicate that the list object being used
is a Collection.
|
private static int | INFO_ENUMERATION - Flag to indicate that the list object being used
is an Enumeration
|
private static int | INFO_ITERATOR - Flag to indicate that the list object being used
provides an Iterator.
|
private static int | INFO_MAP - Flag to indicate that the list object being used
is a Map.
|
private static int | UNKNOWN
|
private int | counterInitialValue - What value to start the loop counter at.
|
private String | counterName - The name of the variable to use when placing
the counter value into the context.
|
private String | elementKey - The reference name used to access each
of the elements in the list object.
|
INFO_ARRAY
private static final int INFO_ARRAY
Flag to indicate that the list object being used
in an array.
- 1
INFO_COLLECTION
private static final int INFO_COLLECTION
Flag to indicate that the list object being used
is a Collection.
- 4
INFO_ENUMERATION
private static final int INFO_ENUMERATION
Flag to indicate that the list object being used
is an Enumeration
- 5
INFO_ITERATOR
private static final int INFO_ITERATOR
Flag to indicate that the list object being used
provides an Iterator.
- 2
INFO_MAP
private static final int INFO_MAP
Flag to indicate that the list object being used
is a Map.
- 3
UNKNOWN
private static final int UNKNOWN
- -1
counterInitialValue
private int counterInitialValue
What value to start the loop counter at.
counterName
private String counterName
The name of the variable to use when placing
the counter value into the context. Right
now the default is $velocityCount.
elementKey
private String elementKey
The reference name used to access each
of the elements in the list object. It
is the $item in the following:
#foreach ($item in $list)
This can be used class wide because
it is immutable.
getName
public String getName()
Return name of this directive.
- getName in interface Directive
getType
public int getType()
Return type of this directive.
- getType in interface Directive
Copyright © 2003 Apache Software Foundation. All Rights Reserved.