Class Directive
- java.lang.Object
-
- net.sourceforge.pmd.lang.vm.directive.Directive
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
Block,Break,Evaluate,Foreach,InputBase,Literal,Macro,RuntimeMacro,Stop,VelocimacroProxy
public abstract class Directive extends java.lang.Object implements java.lang.CloneableBase class for all directives used in Velocity.- Version:
- $Id: Directive.java 778045 2009-05-23 22:17:46Z nbubna $
- Author:
- Jason van Zyl, Nathan Bubna
-
-
Constructor Summary
Constructors Constructor Description Directive()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetColumn()for log msg purposesintgetLine()for log msg purposesabstract java.lang.StringgetName()Return the name of this directive.java.lang.StringgetScopeName()java.lang.StringgetTemplateName()abstract intgetType()Get the directive type BLOCK/LINE.booleanisScopeProvided()voidsetLocation(int line, int column)Allows the template location to be set.voidsetLocation(int line, int column, java.lang.String templateName)Allows the template location to be set.
-
-
-
Field Detail
-
BLOCK
public static final int BLOCK
Block directive indicator- See Also:
- Constant Field Values
-
LINE
public static final int LINE
Line directive indicator- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public abstract java.lang.String getName()
Return the name of this directive.- Returns:
- The name of this directive.
-
getType
public abstract int getType()
Get the directive type BLOCK/LINE.- Returns:
- The directive type BLOCK/LINE.
-
setLocation
public void setLocation(int line, int column)Allows the template location to be set.- Parameters:
line-column-
-
setLocation
public void setLocation(int line, int column, java.lang.String templateName)Allows the template location to be set.- Parameters:
line-column-
-
getLine
public int getLine()
for log msg purposes- Returns:
- The current line for log msg purposes.
-
getColumn
public int getColumn()
for log msg purposes- Returns:
- The current column for log msg purposes.
-
getTemplateName
public java.lang.String getTemplateName()
- Returns:
- The template file name this directive was defined in, or null if not defined in a file.
-
getScopeName
public java.lang.String getScopeName()
- Returns:
- the name to be used when a scope control is provided for this directive.
-
isScopeProvided
public boolean isScopeProvided()
- Returns:
- true if there will be a scope control injected into the context when rendering this directive.
-
-