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.context
Class EvaluateContext

    java.lang.Object
      org.apache.velocity.context.ChainedInternalContextAdapter
          org.apache.velocity.context.EvaluateContext

All Implemented Interfaces:
  Context, InternalContextAdapter, InternalEventContext, org.apache.velocity.context.InternalHousekeepingContext, InternalWrapperContext

Deprecated. Will be removed in 2.0

public class EvaluateContext
extends ChainedInternalContextAdapter

This is a special, internal-use-only context implementation to be used for the #evaluate directive. We use this context to chain the existing context, preventing any changes from impacting the parent context. By separating this context into a separate class it also allows for the future possibility of changing the context behavior for the #evaluate directive. Note that the context used to store values local to #evaluate() is user defined but defaults to `VelocityContext`.

Since:
  1.6
Version:
  $Id: EvaluateContext.java 898032 2010-01-11 19:51:03Z nbubna $
Author:
  Will Glass-Husain

Field Summary

Fields inherited from class org.apache.velocity.context.ChainedInternalContextAdapter
`innerContext`

Constructor Summary
`EvaluateContext(InternalContextAdapter inner, RuntimeServices rsvc)` Deprecated. CTOR, wraps an ICA

Method Summary
`boolean` | `containsKey(Object key)` Deprecated. Indicates whether the specified key is in the context.
`Object` | `get(String key)` Deprecated. Retrieves from local or global context.
`Object[]` | `getKeys()` Deprecated. Get all the keys for the values in the context.
`Object` | `localPut(String key, Object value)` Deprecated. Allows callers to explicitly put objects in the local context.
`Object` | `put(String key, Object value)` Deprecated. Put method also stores values in local scope
`Object` | `remove(Object key)` Deprecated. Removes the value associated with the specified key from the context.

Methods inherited from class org.apache.velocity.context.ChainedInternalContextAdapter
`attachEventCartridge, getBaseContext, getCurrentMacroCallDepth, getCurrentMacroName, getCurrentResource, getCurrentTemplateName, getEventCartridge, getInternalUserContext, getMacroLibraries, getMacroNameStack, getTemplateNameStack, icacheGet, icachePut, popCurrentMacroName, popCurrentTemplateName, pushCurrentMacroName, pushCurrentTemplateName, setCurrentResource, setMacroLibraries`

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

Constructor Detail

### EvaluateContext

    public EvaluateContext(InternalContextAdapter inner,
                           RuntimeServices rsvc)

  Deprecated.
  CTOR, wraps an ICA

Parameters:
  `inner` - context for parent template
  `rsvc` -

Method Detail

### put

    public Object put(String key,
                      Object value)

  Deprecated.
  Put method also stores values in local scope

  Specified by:
    `put` in interface `Context`
  Overrides:
    `put` in class `ChainedInternalContextAdapter`
  Parameters:
    `key` - name of item to set
    `value` - object to set to key
  Returns:
    old stored object

### get

    public Object get(String key)

  Deprecated.
  Retrieves from local or global context.

  Specified by:
    `get` in interface `Context`
  Overrides:
    `get` in class `ChainedInternalContextAdapter`
  Parameters:
    `key` - name of item to get
  Returns:
    stored object or null

### containsKey

    public boolean containsKey(Object key)

  Deprecated.
  Description copied from interface: `Context`
  Indicates whether the specified key is in the context.

  Specified by:
    `containsKey` in interface `Context`
  Overrides:
    `containsKey` in class `ChainedInternalContextAdapter`
  See Also:
    `Context.containsKey(java.lang.Object)`

### getKeys

    public Object[] getKeys()

  Deprecated.
  Description copied from interface: `Context`
  Get all the keys for the values in the context.

  Specified by:
    `getKeys` in interface `Context`
  Overrides:
    `getKeys` in class `ChainedInternalContextAdapter`
  See Also:
    `Context.getKeys()`

### remove

    public Object remove(Object key)

  Deprecated.
  Description copied from interface: `Context`
  Removes the value associated with the specified key from the context.

  Specified by:
    `remove` in interface `Context`
  Overrides:
    `remove` in class `ChainedInternalContextAdapter`
  See Also:
    `Context.remove(java.lang.Object)`

### localPut

    public Object localPut(String key,
                           Object value)

  Deprecated.
  Allows callers to explicitly put objects in the local context. Objects added to the context through this method always end up in the top-level context of possible wrapped contexts.

  Specified by:
    `localPut` in interface `InternalWrapperContext`
  Overrides:
    `localPut` in class `ChainedInternalContextAdapter`
  Parameters:
    `key` - name of item to set.
    `value` - object to set to key.
  Returns:
    old stored object
  See Also:
    `InternalWrapperContext.localPut(java.lang.String,java.lang.Object)`

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.