Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
IExtensionSpecification |
|
| 1.0;1 |
1 | // Copyright 2004, 2005 The Apache Software Foundation |
|
2 | // |
|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
|
4 | // you may not use this file except in compliance with the License. |
|
5 | // You may obtain a copy of the License at |
|
6 | // |
|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
|
8 | // |
|
9 | // Unless required by applicable law or agreed to in writing, software |
|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12 | // See the License for the specific language governing permissions and |
|
13 | // limitations under the License. |
|
14 | ||
15 | package org.apache.tapestry.spec; |
|
16 | ||
17 | import java.util.Map; |
|
18 | ||
19 | import org.apache.hivemind.LocationHolder; |
|
20 | import org.apache.tapestry.util.IPropertyHolder; |
|
21 | ||
22 | /** |
|
23 | * Defines an "extension", which is much like a helper bean, but is part of a |
|
24 | * library or application specification (and has the same lifecycle as the |
|
25 | * application). |
|
26 | * |
|
27 | * @author glongman@intelligentworks.com |
|
28 | */ |
|
29 | public interface IExtensionSpecification extends IPropertyHolder, |
|
30 | LocationHolder |
|
31 | { |
|
32 | ||
33 | String getClassName(); |
|
34 | ||
35 | void setClassName(String className); |
|
36 | ||
37 | void addConfiguration(String propertyName, String value); |
|
38 | ||
39 | /** |
|
40 | * Returns an immutable Map of the configuration; keyed on property name, |
|
41 | * with values as properties to assign. |
|
42 | */ |
|
43 | Map getConfiguration(); |
|
44 | ||
45 | /** |
|
46 | * Invoked to instantiate an instance of the extension and return it. It |
|
47 | * also configures properties of the extension. |
|
48 | */ |
|
49 | Object instantiateExtension(); |
|
50 | ||
51 | /** |
|
52 | * Returns true if the extensions should be instantiated immediately after |
|
53 | * the containing {@link org.apache.tapestry.spec.LibrarySpecification}if |
|
54 | * parsed. Non-immediate extensions are instantiated only as needed. |
|
55 | */ |
|
56 | boolean isImmediate(); |
|
57 | ||
58 | void setImmediate(boolean immediate); |
|
59 | } |