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 Scope

    java.lang.Object
      java.util.AbstractMap
          org.apache.velocity.runtime.directive.Scope

All Implemented Interfaces:
  Map

Direct Known Subclasses:
  ForeachScope

public class Scope
extends AbstractMap

This handles context scoping and metadata for directives.

Version:
  $Id$
Author:
  Nathan Bubna

Nested Class Summary
`static class` | `Scope.Info` Class to encapsulate and provide access to info about the current scope for debugging.

Nested classes inherited from class java.util.Map
`Map.Entry`

Field Summary
`protected Object` | `owner`

Constructor Summary
`Scope(Object owner, Object previous)`

Method Summary
`Set` | `entrySet()`
`Object` | `get(Object key)`
`protected int` | `getDepth()` Returns the number of control arguments of this type that are stacked up.
`Scope.Info` | `getInfo()` Returns info about the current scope for debugging purposes.
`Scope` | `getParent()` Returns the parent control reference overridden by the placement of this instance in the context.
`Object` | `getReplaced()` Returns the user's context reference overridden by the placement of this instance in the context.
`Scope` | `getTopmost()` Returns the topmost parent control reference, retrieved by simple recursion on `getParent()`.
`Object` | `put(Object key, Object value)`
`protected void` | `stop()` Allows #stop to easily trigger the proper StopCommand for this scope.

Methods inherited from class java.util.AbstractMap
`clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### owner

    protected final Object owner

Constructor Detail

### Scope

    public Scope(Object owner,
                 Object previous)

Method Detail

### entrySet

    public Set entrySet()

### get

    public Object get(Object key)

### put

    public Object put(Object key,
                      Object value)

### stop

    protected void stop()

  Allows #stop to easily trigger the proper StopCommand for this scope.

### getDepth

    protected int getDepth()

  Returns the number of control arguments of this type that are stacked up. This is the distance between this instance and the topmost instance, plus one. This value will never be negative or zero.

### getTopmost

    public Scope getTopmost()

  Returns the topmost parent control reference, retrieved by simple recursion on `getParent()`.

### getParent

    public Scope getParent()

  Returns the parent control reference overridden by the placement of this instance in the context.

### getReplaced

    public Object getReplaced()

  Returns the user's context reference overridden by the placement of this instance in the context. If there was none (as is hoped), then this will return null. This never returns parent controls; those are returned by `getParent()`.

### getInfo

    public Scope.Info getInfo()

  Returns info about the current scope for debugging purposes.

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.