com.sun.slamd.scripting.engine
Class Instruction

java.lang.Object
  extended bycom.sun.slamd.scripting.engine.Instruction
Direct Known Subclasses:
AssignmentInstruction, BreakInstruction, ContinueInstruction, IfElseInstruction, IfNotInstruction, InstructionBlock, LoopInstruction, MethodCallInstruction, WhileInstruction, WhileNotInstruction

public abstract class Instruction
extends java.lang.Object

This class defines a generic instruction that can be executed as part of an LDAP script.


Constructor Summary
Instruction(int lineNumber)
          Creates a new instruction.
 
Method Summary
abstract  void debugExecute(JobClass jobThread)
          Performs the function associated with this instruction, writing debug information about its execution to the client's message writer using the writeVerbose method.
abstract  void execute(JobClass jobThread)
          Performs the function associated with this instruction.
 int getLineNumber()
          Retrieves the line number on which this instruction starts in the script.
 java.lang.String toString()
          Retrieves a string representation of this instruction as could be found in a script file.
abstract  java.lang.String toString(int indent)
          Retrieves a string representation of this instruction as could be found in a script file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Instruction

public Instruction(int lineNumber)
Creates a new instruction.

Parameters:
lineNumber - The line number of the script on which the instruction starts.
Method Detail

getLineNumber

public int getLineNumber()
Retrieves the line number on which this instruction starts in the script.

Returns:
The line number on which this instruction starts in the script.

execute

public abstract void execute(JobClass jobThread)
                      throws ScriptException
Performs the function associated with this instruction.

Parameters:
jobThread - The job thread that will be executing the script.
Throws:
ScriptException - If a problem occurs while processing this instruction.

debugExecute

public abstract void debugExecute(JobClass jobThread)
                           throws ScriptException
Performs the function associated with this instruction, writing debug information about its execution to the client's message writer using the writeVerbose method.

Parameters:
jobThread - The job thread that will be executing the script.
Throws:
ScriptException - If a problem occurs while processing this instruction.

toString

public java.lang.String toString()
Retrieves a string representation of this instruction as could be found in a script file. It may consist of multiple lines if necessary.

Returns:
A string representation of this instruction as could be found in a script file.

toString

public abstract java.lang.String toString(int indent)
Retrieves a string representation of this instruction as could be found in a script file. It may consist of multiple lines if necessary.

Parameters:
indent - The number of spaces to indent the output.
Returns:
A string representation of this instruction as could be found in a script file.