|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quattor.pan.template.Template
public class Template
An immutable Template class that corresponds to a single pan language
template. At creation, some additional constraints are enforced which are not
caught by the parsing process. The constructor will throw a
SyntaxException if any of the additional constraints are not
met.
| Nested Class Summary | |
|---|---|
static class |
Template.TemplateType
An enumeration of the possible template types. |
| Field Summary | |
|---|---|
java.lang.String |
name
The (valid) name of this template. |
java.io.File |
source
The source from which this template was constructed. |
SourceFile |
sourceFile
Information about the source file from which this template was constructed. |
Template.TemplateType |
type
The type of this template. |
static java.util.regex.Pattern |
validTemplateNameChars
Pattern with all valid characters for namespaced name. |
| Constructor Summary | |
|---|---|
Template(java.io.File source,
SourceRange sourceRange,
Template.TemplateType type,
java.lang.String name,
java.util.List<Statement> statements)
Constructs a new template from the given information. |
|
Template(java.lang.String name)
Constructs a new object template with the given name which contains no statements. |
|
| Method Summary | |
|---|---|
static boolean |
checkValidInclude(Template.TemplateType includeeType,
Template.TemplateType includedType)
Determine whether a particular include combination is legal. |
void |
execute(boolean runStatic,
Context context)
Execute each of the statements in turn. |
static boolean |
isValidTemplateName(java.lang.String name)
Check to see if the given name is a valid template name. |
void |
templateNameVerification(java.lang.String expectedName)
Check that the internal template name matches the expected template name. |
java.lang.String |
toString()
Create a reasonable string representation of this template. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.regex.Pattern validTemplateNameChars
public final SourceFile sourceFile
public final java.io.File source
public final java.lang.String name
public final Template.TemplateType type
| Constructor Detail |
|---|
public Template(java.lang.String name)
throws SyntaxException
SyntaxException
public Template(java.io.File source,
SourceRange sourceRange,
Template.TemplateType type,
java.lang.String name,
java.util.List<Statement> statements)
throws SyntaxException
source - absolute File indicating the source pan language template;
used for error messages and logging; may be nullsourceRange - the source range for the template declarationtype - TemplateType for this templatename - String indicating the name of this templatestatements - List of statements in this template (may be null)
SyntaxException| Method Detail |
|---|
public static boolean isValidTemplateName(java.lang.String name)
name - template name to check for validity
public void execute(boolean runStatic,
Context context)
runStatic - flag which indicates whether to run the static statements or
notcontext - context for the evaluation of the template
public static boolean checkValidInclude(Template.TemplateType includeeType,
Template.TemplateType includedType)
includeeType - type of the template that is including another oneincludedType - type of the included template
public void templateNameVerification(java.lang.String expectedName)
throws SyntaxException
expectedName - expected name of the compiled template
SyntaxExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||