|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.runtime.directive.Directive org.apache.velocity.runtime.directive.RuntimeMacro
public class RuntimeMacro
This class acts as a proxy for potential macros. When the AST is built this class is inserted as a placeholder for the macro (whether or not the macro is actually defined). At render time we check whether there is a implementation for the macro call. If an implementation cannot be found the literal text is rendered.
Field Summary | |
---|---|
protected boolean |
strictRef
Indicates if we are running in strict reference mode. |
Fields inherited from class org.apache.velocity.runtime.directive.Directive |
---|
rsvc |
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants |
---|
BLOCK, LINE |
Constructor Summary | |
---|---|
RuntimeMacro(String macroName,
String sourceTemplate)
Create a RuntimeMacro instance. |
Method Summary | |
---|---|
String |
getName()
Return name of this Velocimacro. |
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. |
Methods inherited from class org.apache.velocity.runtime.directive.Directive |
---|
getColumn, getLine, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean strictRef
Constructor Detail |
---|
public RuntimeMacro(String macroName, String sourceTemplate)
macroName
- name of the macrosourceTemplate
- template where macro call is madeMethod Detail |
---|
public String getName()
getName
in class Directive
public int getType()
getType
in class Directive
public void init(RuntimeServices rs, InternalContextAdapter context, Node node)
init
in class Directive
rs
- runtime servicescontext
- 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |