Class RuntimeMacro
- java.lang.Object
-
- net.sourceforge.pmd.lang.vm.directive.Directive
-
- net.sourceforge.pmd.lang.vm.directive.RuntimeMacro
-
- All Implemented Interfaces:
java.lang.Cloneable
public class RuntimeMacro extends Directive
This class acts as a proxy for potential macros. When the AST is built this class is inserted as a placeholder for the macro (whether or not the macro is actually defined). At render time we check whether there is a implementation for the macro call. If an implementation cannot be found the literal text is rendered.- Since:
- 1.6
-
-
Constructor Summary
Constructors Constructor Description RuntimeMacro(java.lang.String macroName)
Create a RuntimeMacro instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
Return name of this Velocimacro.java.lang.String
getScopeName()
Override to always return "macro".int
getType()
Velocimacros are always LINE type directives.-
Methods inherited from class net.sourceforge.pmd.lang.vm.directive.Directive
getColumn, getLine, getTemplateName, isScopeProvided, setLocation, setLocation
-
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Return name of this Velocimacro.
-
getScopeName
public java.lang.String getScopeName()
Override to always return "macro". We don't want to use the macro name here, since when writing VTL that uses the scope, we are within a #macro call. The macro name will instead be used as the scope name when defining the body of a BlockMacro.- Overrides:
getScopeName
in classDirective
- Returns:
- the name to be used when a scope control is provided for this directive.
-
-