org.quattor.pan.statement
Class ComputedIncludeStatement

java.lang.Object
  extended by org.quattor.pan.statement.Statement
      extended by org.quattor.pan.statement.IncludeStatement
          extended by org.quattor.pan.statement.ComputedIncludeStatement

public class ComputedIncludeStatement
extends IncludeStatement

Evaluates a DML expression and then executes the named template. If the DML block evaluates to Undef or Null, nothing is done.

Author:
loomis

Constructor Summary
ComputedIncludeStatement(SourceRange sourceRange, Operation dml)
          Constructor to create a ComputedIncludeStatement which will execute a template named by the result of the DML block.
 
Method Summary
 void execute(Context context)
          Execute this Statement within the given context.
 java.lang.String toString()
          Return a reasonable string representation of this statement.
 
Methods inherited from class org.quattor.pan.statement.IncludeStatement
executeWithNamedTemplate, newIncludeStatement
 
Methods inherited from class org.quattor.pan.statement.Statement
getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComputedIncludeStatement

public ComputedIncludeStatement(SourceRange sourceRange,
                                Operation dml)
Constructor to create a ComputedIncludeStatement which will execute a template named by the result of the DML block. If the result of the DML block is Undef or Null, then this statement does nothing. If the DML block evaluates to something other than a StringProperty, Undef, or Null an exception is thrown.

Parameters:
sourceRange - source location of this statement
dml - DML block used to compute the template name
Method Detail

execute

public void execute(Context context)
Description copied from class: Statement
Execute this Statement within the given context.

Specified by:
execute in class Statement
Parameters:
context - DML context to use for the evalution of this statement

toString

public java.lang.String toString()
Return a reasonable string representation of this statement.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this ComputedIncludeStatement


Copyright © 2011 Quattor. All Rights Reserved.