Class ForeachContext


public class ForeachContext extends ArgumentBasedContext
This represents the semantics of the FOR EACH control in an action script. Provides a compact way to iterate over a collection.
  • Constructor Details

  • Method Details

    • setupNextStep

      protected void setupNextStep()
      Description copied from class: Context
      If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.
      Overrides:
      setupNextStep in class Context
    • setupArguments

      protected void setupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs)
      Sets up the variable for the "foreach" context.
      Specified by:
      setupArguments in class ArgumentBasedContext
      Parameters:
      inputArgs - should be 2 arguments: element and collection
    • resetConcreteContext

      protected void resetConcreteContext()
      Description copied from class: Context
      This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.
      Overrides:
      resetConcreteContext in class Context
    • copy

      public ForeachContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context