|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Define
Directive that puts an unrendered AST block in the context under the specified key, postponing rendering until the reference is used and rendered.
| Nested Class Summary | |
static class |
Define.Block
actual class placed in the context, holds the context and writer being used for the render, as well as the parent (which already holds everything else we need). |
| Field Summary |
| 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 | |
Define()
|
|
| Method Summary | |
String |
getName()
Return name of this directive. |
int |
getType()
Return type of this directive. |
protected String |
id(InternalContextAdapter context)
Creates a string identifying the source and location of the block definition, and the current template being rendered if that is different. |
void |
init(RuntimeServices rs,
InternalContextAdapter context,
Node node)
simple init - get the key |
boolean |
render(InternalContextAdapter context,
Writer writer,
Node node)
directive.render() simply makes an instance of the Block inner class and places it into the context as indicated. |
| Methods inherited from class org.apache.velocity.runtime.directive.Directive |
getColumn, getLine, getTemplateName, setLocation, setLocation |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Define()
| Method Detail |
public String getName()
getName in class Directivepublic int getType()
getType in class Directive
public void init(RuntimeServices rs,
InternalContextAdapter context,
Node node)
throws TemplateInitException
init in class Directivers - context - node -
TemplateInitException
public boolean render(InternalContextAdapter context,
Writer writer,
Node node)
render in class Directivecontext - writer - node -
protected String id(InternalContextAdapter context)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||