org.infolayer.templates.elements
Class TE_iterate
java.lang.Object
org.kxml2.kdom.Element
org.infolayer.templates.TemplateElement
org.infolayer.templates.elements.TE_iterate
- public class TE_iterate
- extends TemplateElement
Processes all child elements for each element of the collection
obtained from evaluating the expr-attribute. For the
child elements, the context is set to the corresponding
element of the collection for each iteration. When a var
attribute is given, the corresponding variable name is used
as iterator variable instead of the evaluation context (self).
The orderBy-attribute can be used to iterate over the
elements ordered by the given OCL expression. The
counter-attribute allows to declare an integer variable
holding the current element index in each iteration.
Attributes
- expr
- Contains an OCL expression that must result
in an collection. For each element of the resulting collection,
the child elements of iterate are processed. If
omitted, the current context must be a collection which
is used for iteration
- iterator
- If present, the given variable name is used
as iterator instead of self.
- orderBy
- If present, the given expression is used
to determine the iteration ordering of the elements of the
source collection.
- inverse
- If present and the value is true,
the elements of the collection are iterated in inverse
order.
- counter
- If present, the given variable name
is used to declare an integer variable holding the
current element index.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TE_iterate
public TE_iterate()
init
public void init()
- Overrides:
init
in class TemplateElement
invert
public static java.util.Iterator invert(java.util.Iterator e)
getEnumeration
public java.util.Iterator getEnumeration(Bindings bindings)
apply
public void apply(XmlSerializer xw,
IlRequest context,
Bindings bindings)
throws java.io.IOException
- Description copied from class:
TemplateElement
- Applies the template mechanism. Must be overwritten in the
- Overrides:
apply
in class TemplateElement
- Throws:
java.io.IOException