Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tripi.asp
Class ForEachNode  view ForEachNode download ForEachNode.java

java.lang.Object
  extended bycom.tripi.asp.ForEachNode
All Implemented Interfaces:
Node

public class ForEachNode
extends java.lang.Object
implements Node

The ForEachNode class handles the FOR EACH .. IN .. statement in VBScript.

Version:
0.9

Field Summary
(package private)  BlockNode block
          The block to execute for each statement
(package private)  org.apache.log4j.Category DBG
          The debugging class
(package private)  Node expr
          The expression we are looping through
(package private)  IdentNode ident
          The identifier of the loop variable
 
Constructor Summary
ForEachNode(IdentNode ident, Node expr, BlockNode block)
          Constructor.
 
Method Summary
 void dump()
          Dumps the visual representation of this script.
 java.lang.Object execute(AspContext context)
          Executes this node.
private  void executeArrayNode(ArrayNode array, AspContext context)
          Internal function which handles the enumeration of ArrayNode object.
private  void executeJavaObjectNode(JavaObjectNode javaObj, AspContext context)
          Internal function which handles the enumeration of JavaObjectNode objects.
private  void executeSimpleMap(SimpleMap map, AspContext context)
          Internal function which handles the enumeration of SimpleMap object.
 Node getBlock()
          Get the block to use in the loop.
 Node getExpression()
          Get the expression we should use for the loop.
 IdentNode getIdent()
          Get the ident we should use for the loop.
 void prepare(AspContext context)
          Prepares this statement for execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBG

org.apache.log4j.Category DBG
The debugging class


ident

IdentNode ident
The identifier of the loop variable


expr

Node expr
The expression we are looping through


block

BlockNode block
The block to execute for each statement

Constructor Detail

ForEachNode

public ForEachNode(IdentNode ident,
                   Node expr,
                   BlockNode block)
Constructor.

Method Detail

getIdent

public IdentNode getIdent()
Get the ident we should use for the loop.


getExpression

public Node getExpression()
Get the expression we should use for the loop.


getBlock

public Node getBlock()
Get the block to use in the loop.


dump

public void dump()
          throws AspException
Dumps the visual representation of this script.

Specified by:
dump in interface Node

prepare

public void prepare(AspContext context)
             throws AspException
Prepares this statement for execution. Calls prepare on the block of statements contained within the for loop.

Specified by:
prepare in interface Node

execute

public java.lang.Object execute(AspContext context)
                         throws AspException
Executes this node.

Specified by:
execute in interface Node

executeJavaObjectNode

private void executeJavaObjectNode(JavaObjectNode javaObj,
                                   AspContext context)
                            throws AspException
Internal function which handles the enumeration of JavaObjectNode objects. XXX This is probably a bad idea, and should be moved somewhere else (like a new class: JavaArrayNode).


executeArrayNode

private void executeArrayNode(ArrayNode array,
                              AspContext context)
                       throws AspException
Internal function which handles the enumeration of ArrayNode object.


executeSimpleMap

private void executeSimpleMap(SimpleMap map,
                              AspContext context)
                       throws AspException
Internal function which handles the enumeration of SimpleMap object.