org.infolayer.templates.elements
Class TE_forAll

java.lang.Object
  extended byorg.kxml2.kdom.Element
      extended byorg.infolayer.templates.TemplateElement
          extended byorg.infolayer.templates.elements.TE_forAll

public class TE_forAll
extends TemplateElement

Processes all child elements for each element of the collection obtained from evaluating the expr-attribute. If the type of expr is OclType, an implicit call to allInstances() is performed to obtain a set. If the expr attribute is omitted, it defaults to the expression self.

When a iterator attribute is given, its value is used as the name of an iterator variable. Otherwise, the evaluation context (self) is set accordingly in each iteration step. The counter-attribute allows to declare an integer variable, holding the current element index in each iteration step.

Attributes

expr
Contains an OCL expression that must result in an collection.
iterator
If present, the value denotes an iterator variable name that is used instead of self.
counter
If present, the given variable name is used to declare an integer variable holding the current element index.

See Also:
Serialized Form

Constructor Summary
TE_forAll()
           
 
Method Summary
 void apply(XmlSerializer xw, IlRequest context, Bindings bindings)
          Applies the template mechanism.
 java.util.Iterator getEnumeration(Bindings bindings)
           
 void init()
           
 
Methods inherited from class org.infolayer.templates.TemplateElement
applyChildren, assertNoChildren, assertNoChildren, getAttributeValue, getVarDefs, readTextContent, setVarDefs, writeAttributes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TE_forAll

public TE_forAll()
Method Detail

init

public void init()
Overrides:
init in class TemplateElement

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