org.quattor.pan.statement
Class IncludeStatement

java.lang.Object
  extended by org.quattor.pan.statement.Statement
      extended by org.quattor.pan.statement.IncludeStatement
Direct Known Subclasses:
ComputedIncludeStatement, StaticIncludeStatement

public abstract class IncludeStatement
extends Statement

Executes another referenced template whose name is either a constant or computed from a DML expression. This superclass is used to collect the common functionality of the static and computed include statements.

Author:
loomis

Constructor Summary
protected IncludeStatement(SourceRange sourceRange)
          Constructor which must be called by subclasses.
 
Method Summary
protected  void executeWithNamedTemplate(Context context, java.lang.String name)
          This is a utility method which performs an include from a fixed template name.
static IncludeStatement newIncludeStatement(SourceRange sourceRange, Operation dml)
           
 
Methods inherited from class org.quattor.pan.statement.Statement
execute, getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncludeStatement

protected IncludeStatement(SourceRange sourceRange)
Constructor which must be called by subclasses. The IncludeStatement itself is abstract, so a direct instance of this class cannot be created.

Parameters:
sourceRange - source location of this statement
Method Detail

newIncludeStatement

public static IncludeStatement newIncludeStatement(SourceRange sourceRange,
                                                   Operation dml)
                                            throws SyntaxException
Throws:
SyntaxException

executeWithNamedTemplate

protected void executeWithNamedTemplate(Context context,
                                        java.lang.String name)
                                 throws EvaluationException
This is a utility method which performs an include from a fixed template name. The validity of the name should be checked by the subclass; this avoids unnecessary regular expression matching.

Parameters:
context - evaluation context to use
name - fixed template name
Throws:
EvaluationException


Copyright © 2011 Quattor. All Rights Reserved.