org.webmacro
Class ContextTool

java.lang.Object
  extended byorg.webmacro.ContextTool
All Implemented Interfaces:
ContextObjectFactory
Direct Known Subclasses:
CGITool, CookieTool, FormListTool, FormTool, ListTool, LocaleTool, MathTool, RequestTool, ResponseTool, SessionTool, TemplateTool, TextTool, TypeTool, URLTool, VariableTool

public abstract class ContextTool
extends java.lang.Object
implements ContextObjectFactory

This class is used as a base class for legacy context tools so they can fit into the ContextObjectFactory framework.


Constructor Summary
ContextTool()
           
 
Method Summary
 java.lang.Object get(Context c)
          Return an object which is suitable for placement in the context.
abstract  java.lang.Object init(Context c)
          A new tool object will be instantiated per-request by calling this method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextTool

public ContextTool()
Method Detail

init

public abstract java.lang.Object init(Context c)
                               throws PropertyException
A new tool object will be instantiated per-request by calling this method. A ContextTool is effectively a factory used to create objects for use in templates. Some tools may simply return themselves from this method; others may instantiate new objects to hold the per-request state.

Throws:
PropertyException

get

public java.lang.Object get(Context c)
                     throws PropertyException
Description copied from interface: ContextObjectFactory
Return an object which is suitable for placement in the context. This might be a new context-specific object, or a shared instance of an immutable object.

Specified by:
get in interface ContextObjectFactory
Throws:
PropertyException


Copyright © 1999-2006 WebMacro. All Rights Reserved.