public class RuntimeMacro extends Directive
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
strictRef
Indicates if we are running in strict reference mode.
|
BLOCK, LINE| Constructor and Description |
|---|
RuntimeMacro(String macroName)
Create a RuntimeMacro instance.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Return name of this Velocimacro.
|
String |
getScopeName()
Override to always return "macro".
|
int |
getType()
Velocimacros are always LINE
type directives.
|
void |
init(RuntimeServices rs,
InternalContextAdapter context,
Node node)
Intialize the Runtime macro.
|
boolean |
render(InternalContextAdapter context,
Writer writer,
Node node)
Velocimacro implementation is not known at the init time.
|
boolean |
render(InternalContextAdapter context,
Writer writer,
Node node,
Renderable body)
This method is used with BlockMacro when we want to render a macro with a body AST.
|
getColumn, getLine, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocationprotected boolean strictRef
public RuntimeMacro(String macroName)
macroName - name of the macropublic String getName()
public String getScopeName()
getScopeName in class Directivepublic int getType()
public void init(RuntimeServices rs, InternalContextAdapter context, Node node)
public boolean render(InternalContextAdapter context, Writer writer, Node node) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException
render in class Directivecontext - writer - node - IOExceptionResourceNotFoundExceptionParseErrorExceptionMethodInvocationExceptionpublic boolean render(InternalContextAdapter context, Writer writer, Node node, Renderable body) throws IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException
context - writer - node - body - AST block that was enclosed in the macro body.IOExceptionResourceNotFoundExceptionParseErrorExceptionMethodInvocationExceptionCopyright © 2000–2016. All rights reserved.