org.apache.velocity.runtime.directive

Class Directive

Implemented Interfaces:
Cloneable, DirectiveConstants
Known Direct Subclasses:
Foreach, InputBase, Literal, Macro, VelocimacroProxy

public abstract class Directive
extends java.lang.Object
implements DirectiveConstants, Cloneable

Base class for all directives used in Velocity.
Version:
$Id: Directive.java,v 1.18.4.1 2004/03/03 23:22:55 geirm Exp $
Author:
Jason van Zyl

Field Summary

private int
column
private int
line
protected RuntimeServices
rsvc

Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants

BLOCK, LINE

Method Summary

int
getColumn()
for log msg purposes
int
getLine()
for log msg purposes
abstract String
getName()
Return the name of this directive
abstract int
getType()
Get the directive type BLOCK/LINE
void
init(RuntimeServices rs, InternalContextAdapter context, Node node)
How this directive is to be initialized.
abstract boolean
render(InternalContextAdapter context, Writer writer, Node node)
How this directive is to be rendered
void
setLocation(int line, int column)
Allows the template location to be set

Field Details

column

private int column

line

private int line

rsvc

protected RuntimeServices rsvc

Method Details

getColumn

public int getColumn()
for log msg purposes

getLine

public int getLine()
for log msg purposes

getName

public abstract String getName()
Return the name of this directive

getType

public abstract int getType()
Get the directive type BLOCK/LINE

init

public void init(RuntimeServices rs,
                 InternalContextAdapter context,
                 Node node)
            throws Exception
How this directive is to be initialized.

render

public abstract boolean render(InternalContextAdapter context,
                               Writer writer,
                               Node node)
            throws IOException,
                   ResourceNotFoundException,
                   ParseErrorException,
                   MethodInvocationException
How this directive is to be rendered

setLocation

public void setLocation(int line,
                        int column)
Allows the template location to be set

Copyright B) 2002 Apache Software Foundation. All Rights Reserved.