Class VelocityContext

java.lang.Object
com.nomagic.magicreport.engine.velocity.VelocityContext
All Implemented Interfaces:
IContext, Serializable

@OpenApiAll public class VelocityContext extends Object implements IContext
Implementation of the IContext interface for use. This implementation uses a org.apache.velocity.VelocityContext for data storage. org.apache.velocity.VelocityContext is not synchronized. If you need to share a Context between threads with simultaneous access for some reason, please create your own and extend the interface Context
Since:
Jun 11, 2007 10:50:15 PM
Version:
1.0 Jun 11, 2007
See Also:
  • Constructor Details

    • VelocityContext

      public VelocityContext()
      Creates a new instance (with no inner context).
  • Method Details

    • get

      public Object get(String key)
      Gets the value corresponding to the provided key from the context.
      Specified by:
      get in interface IContext
      Parameters:
      key - The name of the desired value.
      Returns:
      The value corresponding to the provided key.
    • remove

      public Object remove(String key)
      Removes the value associated with the specified key from the context.
      Specified by:
      remove in interface IContext
      Parameters:
      key - The name of the value to remove.
      Returns:
      The value that the key was mapped to, or null if unmapped.
    • put

      public Object put(String key, Object value)
      Adds a name/value pair to the context.
      Specified by:
      put in interface IContext
      Parameters:
      key - The name to key the provided value with.
      value - The corresponding value.
      Returns:
      The old object or null if there was no old object.
    • removeAll

      public void removeAll()
      Removes all items from this context.
      Specified by:
      removeAll in interface IContext
    • contextKeys

      public Iterator<String> contextKeys()
      Finds all the keys of the entry in this context.
      Specified by:
      contextKeys in interface IContext
      Returns:
      an Iterator of all the key of the entry in this context.
    • contextKeysArray

      public String[] contextKeysArray()
      Finds all the keys of the entry in this context as array.
      Specified by:
      contextKeysArray in interface IContext
      Returns:
      an array of all the key of the entry in this context.
    • createContext

      public org.apache.velocity.VelocityContext createContext()
      Create a velocity context from template context.
      Returns:
      a velocity context