org.peaseplate.chunk
Class AbstractBlock

java.lang.Object
  extended by org.peaseplate.chunk.AbstractChunk
      extended by org.peaseplate.chunk.AbstractBlock
All Implemented Interfaces:
BlockHead, Chunk
Direct Known Subclasses:
AbstractIfBlock, ElseBlock, MacroBlock, WhileBlock, WithBlock, WithEachBlock

public abstract class AbstractBlock
extends AbstractChunk
implements BlockHead

The abstract implementation of the block head.

Author:
Manfred HANTSCHEL

Constructor Summary
AbstractBlock(TemplateLocator locator, int line, int column)
           
 
Method Summary
 Chunk[] getBlock()
          Returns the head of the sub block chain.
 void renderBlock(BuildContext context, java.io.Writer writer)
          Renders the sub block to the specified writer using the specified template context
 void setBlock(Chunk[] block)
           
 java.lang.String toString()
          Returns a meaningful representation of this chunk
 
Methods inherited from class org.peaseplate.chunk.AbstractChunk
getColumn, getLine, getLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.peaseplate.chunk.Chunk
getColumn, getLine, getLocator, isEssential, isVisible, render
 

Constructor Detail

AbstractBlock

public AbstractBlock(TemplateLocator locator,
                     int line,
                     int column)
Method Detail

getBlock

public Chunk[] getBlock()
Description copied from interface: BlockHead
Returns the head of the sub block chain.

Specified by:
getBlock in interface BlockHead
Returns:
the head of the block
See Also:
BlockHead.getBlock()

setBlock

public void setBlock(Chunk[] block)
              throws java.lang.IllegalStateException
Specified by:
setBlock in interface BlockHead
Throws:
java.lang.IllegalStateException
See Also:
BlockHead.setBlock(org.peaseplate.chunk.Chunk[])

renderBlock

public void renderBlock(BuildContext context,
                        java.io.Writer writer)
                 throws TemplateException,
                        java.io.IOException
Description copied from interface: BlockHead
Renders the sub block to the specified writer using the specified template context

Specified by:
renderBlock in interface BlockHead
Parameters:
context - the context
writer - the writer
Throws:
TemplateException - on occasion
java.io.IOException - on occasion
See Also:
BlockHead.renderBlock(BuildContext, java.io.Writer)

toString

public java.lang.String toString()
Description copied from interface: Chunk
Returns a meaningful representation of this chunk

Specified by:
toString in interface Chunk
Overrides:
toString in class java.lang.Object
Returns:
a meaningful representation of this chunk
See Also:
Object.toString()


Copyright © 2008. All Rights Reserved.