Directive (Velocity 1.4 API)
Keywords: org.apache.velocity.runtime.directive.Directive class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.velocity.runtime.directive
Class Directive

    java.lang.Object
      org.apache.velocity.runtime.directive.Directive

All Implemented Interfaces:
  java.lang.Cloneable, DirectiveConstants

Direct Known Subclasses:
  Foreach, InputBase, Literal, Macro, VelocimacroProxy

public abstract class Directive
extends java.lang.Object
implements DirectiveConstants, java.lang.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`

Constructor Summary
`Directive()`

Method Summary
`int` | `getColumn()` for log msg purposes
`int` | `getLine()` for log msg purposes
`abstract java.lang.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, java.io.Writer writer, Node node)` How this directive is to be rendered
`void` | `setLocation(int line, int column)` Allows the template location to be set

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### line

    private int line

### column

    private int column

### rsvc

    protected RuntimeServices rsvc

Constructor Detail

### Directive

    public Directive()

Method Detail

### getName

    public abstract java.lang.String getName()

  Return the name of this directive

### getType

    public abstract int getType()

  Get the directive type BLOCK/LINE

### setLocation

    public void setLocation(int line,
                            int column)

  Allows the template location to be set

### getLine

    public int getLine()

  for log msg purposes

### getColumn

    public int getColumn()

  for log msg purposes

### init

    public void init(RuntimeServices rs,
                     InternalContextAdapter context,
                     Node node)
              throws java.lang.Exception

  How this directive is to be initialized.

  Throws:
    `java.lang.Exception`

### render

    public abstract boolean render(InternalContextAdapter context,
                                   java.io.Writer writer,
                                   Node node)
                            throws java.io.IOException,
                                   ResourceNotFoundException,
                                   ParseErrorException,
                                   MethodInvocationException

  How this directive is to be rendered

  Throws:
    `java.io.IOException`
    `ResourceNotFoundException`
    `ParseErrorException`
    `MethodInvocationException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 Apache Software Foundation. All Rights Reserved.