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.
|
checkArgs, getColumn, getLine, getTemplate, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
protected boolean strictRef
public RuntimeMacro(String macroName)
macroName
- name of the macropublic String getName()
public String getScopeName()
getScopeName
in class Directive
public 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 Directive
context
- writer
- node
- IOException
ResourceNotFoundException
ParseErrorException
MethodInvocationException
public 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.IOException
ResourceNotFoundException
ParseErrorException
MethodInvocationException
Copyright © 2000–2016 The Apache Software Foundation. All rights reserved.