org.quattor.pan.statement
Class Statement

java.lang.Object
  extended by org.quattor.pan.statement.Statement
Direct Known Subclasses:
AssignmentStatement, BindStatement, FunctionStatement, IncludeStatement, TypeStatement, VariableStatement

public abstract class Statement
extends java.lang.Object

Provides the superclass of all declarative statements in the pan configuration language. All declarative pan statements operate on the Context of a particular machine profile through the execute method. The arguments and flags for each statement are expected to be different, but this is not important for evaluating the configuration. All statements must be immutable. Subclasses are expected to throw an exception (SyntaxException or EvaluationException) if illegal parameters are passed to the constructor. Similarly, if an error is encountered during the execute() method, an EvaluationException should be thrown.

Author:
loomis

Constructor Summary
Statement(SourceRange sourceRange)
          The base constructor for Statement takes a SourceRange object which indicates the location of the statement within the source file.
 
Method Summary
abstract  void execute(Context context)
          Execute this Statement within the given context.
 SourceRange getSourceRange()
          Retrieve the source location for this Statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statement

public Statement(SourceRange sourceRange)
The base constructor for Statement takes a SourceRange object which indicates the location of the statement within the source file. All subclasses must call this constructor as part of their constructors.

Parameters:
sourceRange - the location of this statement within the source file
Method Detail

getSourceRange

public SourceRange getSourceRange()
Retrieve the source location for this Statement.

Returns:
SourceRange object indicating the source location

execute

public abstract void execute(Context context)
                      throws EvaluationException
Execute this Statement within the given context.

Parameters:
context - DML context to use for the evalution of this statement
Throws:
EvaluationException


Copyright © 2011 Quattor. All Rights Reserved.