01: package org.apache.velocity.tools.view;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
20: */
21:
22: /**
23: * Interface to simplify and abstract tool handling.
24: *
25: * Implementations of this class should hold both the context
26: * key for the tool and sufficient information to return
27: * an instance of the tool.
28: *
29: * @author Nathan Bubna
30: *
31: * @version $Id: ToolInfo.java 479724 2006-11-27 18:49:37Z nbubna $
32: */
33: public interface ToolInfo {
34:
35: /**
36: * @return the context key for the tool
37: */
38: String getKey();
39:
40: /**
41: * @return the fully qualified classname for the tool
42: */
43: String getClassname();
44:
45: /**
46: * Returns an instance of the tool.
47: *
48: * Instances returned may be new on each call, pooled, or
49: * the be same instance every time depending on the
50: * implementation. The object passed to this method may
51: * be used to initialize or create the tool that is returned,
52: * or it may be null if no such data is required.
53: *
54: * @param initData an object that may be used to initialize the instance
55: * @return an instance of the tool
56: */
57: Object getInstance(Object initData);
58:
59: }
|