Save This Page
Home » velocity-1.5 » org.apache » velocity » runtime » directive » [javadoc | source]
org.apache.velocity.runtime.directive
public class: Foreach [javadoc | source]
java.lang.Object
   org.apache.velocity.runtime.directive.Directive
      org.apache.velocity.runtime.directive.Foreach

All Implemented Interfaces:
    Cloneable, DirectiveConstants

Foreach directive used for moving through arrays, or objects that provide an Iterator.
Nested Class Summary:
protected static class  Foreach.NullHolderContext  A special context to use when the foreach iterator returns a null. This is required since the standard context may not support nulls. All puts and gets are passed through, except for the foreach iterator key. 
Field Summary
protected  Info uberInfo    immutable, so create in init 
Fields inherited from org.apache.velocity.runtime.directive.Directive:
rsvc
Method from org.apache.velocity.runtime.directive.Foreach Summary:
getName,   getType,   init,   render
Methods from org.apache.velocity.runtime.directive.Directive:
getColumn,   getLine,   getName,   getType,   init,   render,   setLocation
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.velocity.runtime.directive.Foreach Detail:
 public String getName() 
    Return name of this directive.
 public int getType() 
    Return type of this directive.
 public  void init(RuntimeServices rs,
    InternalContextAdapter context,
    Node node) throws TemplateInitException 
    simple init - init the tree and get the elementKey from the AST
 public boolean render(InternalContextAdapter context,
    Writer writer,
    Node node) throws MethodInvocationException, IOException, ResourceNotFoundException, ParseErrorException 
    renders the #foreach() block