public class BlockMacro extends Block
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> #endWill print:
<strong><u>This text is underlined and bold<u></strong> yeah!bodyContent reference name is configurable (see velocity.properties).
BLOCK, LINE
Constructor and Description |
---|
BlockMacro(String name) |
Modifier and Type | Method and Description |
---|---|
String |
getName()
Return the name of this directive.
|
String |
getScopeName()
Override to use the macro name, since it is within an
#@myMacro() ...
|
getColumn, getLine, getTemplateName, isScopeProvided, setLocation, setLocation
public BlockMacro(String name)
public String getName()
Directive
public String getScopeName()
getScopeName
in class Directive
Copyright © 2002–2015 InfoEther. All rights reserved.