1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.webmacro;
25
26 import org.webmacro.broker.ContextObjectFactory;
27
28 /***
29 * This class is used as a base class for legacy context tools so they can fit into the ContextObjectFactory
30 * framework.
31 */
32 public abstract class ContextTool implements ContextObjectFactory
33 {
34
35 /***
36 * A new tool object will be instantiated per-request by calling
37 * this method. A ContextTool is effectively a factory used to
38 * create objects for use in templates. Some tools may simply return
39 * themselves from this method; others may instantiate new objects
40 * to hold the per-request state.
41 */
42 public abstract Object init (Context c) throws PropertyException;
43
44 public Object get(Context c) throws PropertyException {
45 return init(c);
46 }
47 }