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() |
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,
String name,
InternalContextAdapter context,
Node node)
Initialize 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, init, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation
protected boolean strictRef
public String getName()
public String getScopeName()
getScopeName
in class Directive
public int getType()
public void init(RuntimeServices rs, String name, InternalContextAdapter context, Node node)
rs
- runtime servicesname
- macro namecontext
- InternalContextAdapternode
- node containing the macro callpublic 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–2019 The Apache Software Foundation. All rights reserved.