Class BlockMacro
- java.lang.Object
-
- net.sourceforge.pmd.lang.vm.directive.Directive
-
- net.sourceforge.pmd.lang.vm.directive.Block
-
- net.sourceforge.pmd.lang.vm.directive.BlockMacro
-
- All Implemented Interfaces:
Cloneable
@Deprecated public class BlockMacro extends Block
Deprecated.for removal in PMD 7.0.0BlockMacro directive is used to invoke Velocity macros with normal parameters and a macro body.The macro can then refer to the passed body AST. This directive can be used as a "decorator". Body AST can contain any valid Velocity syntax. An example:
#set($foobar = "yeah!") #macro(strong $txt) <strong>$bodyContent</strong> $txt #end #@strong($foobar) <u>This text is underlined and bold</u> #end
Will print:<strong><u>This text is underlined and bold<u></strong> yeah!
bodyContent reference name is configurable (see velocity.properties).- Since:
- 1.7
- Version:
- $Id$
- Author:
- Jarkko Viinamaki
-
-
Constructor Summary
Constructors Constructor Description BlockMacro(String name)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getName()
Deprecated.Return the name of this directive.String
getScopeName()
Deprecated.Override to use the macro name, since it is within an #@myMacro() ...-
Methods inherited from class net.sourceforge.pmd.lang.vm.directive.Directive
getColumn, getLine, getTemplateName, isScopeProvided, setLocation, setLocation
-
-
-
-
Constructor Detail
-
BlockMacro
public BlockMacro(String name)
Deprecated.
-
-
Method Detail
-
getName
public String getName()
Deprecated.Description copied from class:Directive
Return the name of this directive.
-
getScopeName
public String getScopeName()
Deprecated.Override to use the macro name, since it is within an #@myMacro() ... #end block that the scope in question would be used.- Overrides:
getScopeName
in classDirective
- Returns:
- the name to be used when a scope control is provided for this directive.
-
-