Class Block
java.lang.Object
org.apache.velocity.runtime.directive.Directive
org.apache.velocity.runtime.directive.Block
- All Implemented Interfaces:
 Cloneable,DirectiveConstants
- Direct Known Subclasses:
 BlockMacro,Define
Directive that puts an unrendered AST block in the context
 under the specified key, postponing rendering until the
 reference is used and rendered.
- Since:
 - 1.7
 - Version:
 - $Id: Block.java 686842 2008-08-18 18:29:31Z nbubna $
 - Author:
 - Andrew Tetlaw, Nathan Bubna, Jarkko Viinamaki
 
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classactual class placed in the context, holds the context being used for the render, as well as the parent (which already holds everything else we need). - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Nodeprotected Stringprotected org.slf4j.Loggerprotected intFields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants
BLOCK, LINE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionintgetType()Return type of this directive.protected Stringid(InternalContextAdapter context) Creates a string identifying the source and location of the block definition, and the current template being rendered if that is different.voidinit(RuntimeServices rs, InternalContextAdapter context, Node node) simple init - get the keybooleanrender(InternalContextAdapter context, Writer writer) renders block directiveMethods inherited from class org.apache.velocity.runtime.directive.Directive
checkArgs, getColumn, getLine, getName, getScopeName, getTemplate, getTemplateName, isScopeProvided, makeScope, postRender, preRender, render, setLocation, setLocation 
- 
Field Details
- 
block
 - 
log
protected org.slf4j.Logger log - 
maxDepth
protected int maxDepth - 
key
 
 - 
 - 
Constructor Details
- 
Block
public Block() 
 - 
 - 
Method Details
- 
getType
public int getType()Return type of this directive. - 
init
public void init(RuntimeServices rs, InternalContextAdapter context, Node node) throws TemplateInitException simple init - get the key- Overrides:
 initin classDirective- Parameters:
 rs-context-node-- Throws:
 TemplateInitException
 - 
render
renders block directive- Parameters:
 context-writer-- Returns:
 - success status
 
 - 
id
Creates a string identifying the source and location of the block definition, and the current template being rendered if that is different.- Parameters:
 context-- Returns:
 - id string
 
 
 -