Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
IBeanProvider |
|
| 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; |
|
16 | ||
17 | import java.util.Collection; |
|
18 | ||
19 | import org.apache.hivemind.ApplicationRuntimeException; |
|
20 | import org.apache.hivemind.ClassResolver; |
|
21 | ||
22 | /** |
|
23 | * An object that provides a component with access to helper beans. Helper beans |
|
24 | * are JavaBeans associated with a page or component that are used to extend the |
|
25 | * functionality of the component via aggregation. |
|
26 | * |
|
27 | * @author Howard Lewis Ship |
|
28 | * @since 1.0.4 |
|
29 | */ |
|
30 | ||
31 | public interface IBeanProvider |
|
32 | { |
|
33 | ||
34 | /** |
|
35 | * Returns the JavaBean with the specified name. The bean is created as |
|
36 | * needed. |
|
37 | * |
|
38 | * @throws ApplicationRuntimeException |
|
39 | * if no such bean is available. |
|
40 | */ |
|
41 | ||
42 | Object getBean(String name); |
|
43 | ||
44 | /** |
|
45 | * Returns the {@link IComponent} (which may be a |
|
46 | * {@link org.apache.tapestry.IPage}) for which this bean provider is |
|
47 | * providing beans. |
|
48 | * |
|
49 | * @since 1.0.5 |
|
50 | */ |
|
51 | ||
52 | IComponent getComponent(); |
|
53 | ||
54 | /** |
|
55 | * Returns a collection of the names of any beans which may be provided. |
|
56 | * |
|
57 | * @since 1.0.6 |
|
58 | * @see org.apache.tapestry.spec.IComponentSpecification#getBeanNames() |
|
59 | */ |
|
60 | ||
61 | Collection getBeanNames(); |
|
62 | ||
63 | /** |
|
64 | * Returns true if the provider can provide the named bean. |
|
65 | * |
|
66 | * @since 2.2 |
|
67 | */ |
|
68 | ||
69 | boolean canProvideBean(String name); |
|
70 | ||
71 | /** |
|
72 | * Returns a resource resolver. |
|
73 | * |
|
74 | * @since 1.0.8 |
|
75 | */ |
|
76 | ||
77 | ClassResolver getClassResolver(); |
|
78 | ||
79 | } |