Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||
Component |
|
| 0.0;0 |
1 | // Copyright 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.annotations; |
|
16 | ||
17 | import java.lang.annotation.Documented; |
|
18 | import java.lang.annotation.ElementType; |
|
19 | import java.lang.annotation.Retention; |
|
20 | import java.lang.annotation.RetentionPolicy; |
|
21 | import java.lang.annotation.Target; |
|
22 | ||
23 | /** |
|
24 | * Annotation used within a page or component class to define a contained component (which will |
|
25 | * typically match up against a component reference in the template). This annotation is attached to |
|
26 | * an accessor method. |
|
27 | * |
|
28 | * @author Howard Lewis Ship |
|
29 | * @since 4.0 |
|
30 | */ |
|
31 | @Target( |
|
32 | { ElementType.METHOD }) |
|
33 | @Retention(RetentionPolicy.RUNTIME) |
|
34 | @Documented |
|
35 | public @interface Component { |
|
36 | ||
37 | /** |
|
38 | * The component's id. Defaults to the property name if left unspecified. |
|
39 | */ |
|
40 | ||
41 | String id() default ""; |
|
42 | ||
43 | /** |
|
44 | * The component type. Defaults to the return type class name if left unspecified. |
|
45 | */ |
|
46 | ||
47 | String type() default ""; |
|
48 | ||
49 | /** |
|
50 | * The name of a previously defined component. |
|
51 | * The type and bindings of that component will be copied to this component. |
|
52 | * Either type or copy-of must be specified. |
|
53 | */ |
|
54 | ||
55 | String copyOf() default ""; |
|
56 | ||
57 | /** |
|
58 | * If true, then the component inherits informal parameters from its container. |
|
59 | */ |
|
60 | ||
61 | boolean inheritInformalParameters() default false; |
|
62 | ||
63 | /** |
|
64 | * Bindings for the component. Each binding string is of the format |
|
65 | * <code><em>name</em>=<em>binding refernce</em></code>, where the binding reference is |
|
66 | * the same kind of string (possibly with a prefix such as "ognl:" or "message:" as would appear |
|
67 | * in a specification. |
|
68 | * |
|
69 | * @Binding annotations. |
|
70 | */ |
|
71 | ||
72 | String[] bindings() default {}; |
|
73 | } |