public class RuntimeMacro extends Directive
| Modifier and Type | Field and Description | 
|---|---|
| protected boolean | strictRefIndicates 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, setLocationprotected boolean strictRef
public String getName()
public String getScopeName()
getScopeName in class Directivepublic 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 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–2019 The Apache Software Foundation. All rights reserved.