Define (Velocity 1.7 API)
Keywords: org.apache.velocity.runtime.directive.Define 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 Define

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

All Implemented Interfaces:
  Cloneable, DirectiveConstants

public class Define
extends Block

Directive that puts an unrendered AST block in the context under the specified key, postponing rendering until the reference is used and rendered.

Version:
  $Id: Define.java 686842 2008-08-18 18:29:31Z nbubna $
Author:
  Andrew Tetlaw, Nathan Bubna

Nested Class Summary

Nested classes inherited from class org.apache.velocity.runtime.directive.Block
`Block.Reference`

Field Summary

Fields inherited from class org.apache.velocity.runtime.directive.Block
`block, key, log, maxDepth`

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.
`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.Block
`getType, id, render`

Methods inherited from class org.apache.velocity.runtime.directive.Directive
`getColumn, getLine, getScopeName, getTemplateName, isScopeProvided, makeScope, postRender, preRender, setLocation, setLocation`

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

Constructor Detail

### Define

    public Define()

Method Detail

### getName

    public String getName()

  Return name of this directive.

  Specified by:
    `getName` in class `Directive`
  Returns:
    The name of this directive.

### init

    public void init(RuntimeServices rs,
                     InternalContextAdapter context,
                     Node node)
              throws TemplateInitException

  simple init - get the key

  Overrides:
    `init` in class `Block`
  Throws:
    `TemplateInitException`

### render

    public 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.

  Specified by:
    `render` in class `Directive`
  Parameters:
    `context` -
    `writer` -
    `node` -
  Returns:
    True if the directive rendered successfully.

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 © 2000-2010 Apache Software Foundation. All Rights Reserved.