Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IParameterSpecification |
|
| 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.Collection; | |
18 | ||
19 | import org.apache.hivemind.LocationHolder; | |
20 | ||
21 | /** | |
22 | * Defines a formal parameter to a component. An | |
23 | * <code>IParameterSpecification</code> is contained by a | |
24 | * {@link IComponentSpecification}. | |
25 | * <p> | |
26 | * TBD: Identify arrays in some way. | |
27 | * | |
28 | * @author glongman@intelligentworks.com | |
29 | */ | |
30 | public interface IParameterSpecification extends LocationHolder | |
31 | { | |
32 | ||
33 | /** | |
34 | * Returns the class name of the expected type of the parameter. The default | |
35 | * value is <code>java.lang.Object</code> which matches anything. | |
36 | */ | |
37 | String getType(); | |
38 | ||
39 | /** | |
40 | * Returns true if the parameter is required by the component. The default | |
41 | * is false, meaning the parameter is optional. | |
42 | */ | |
43 | boolean isRequired(); | |
44 | ||
45 | void setRequired(boolean value); | |
46 | ||
47 | /** | |
48 | * Sets the type of value expected for the parameter. This can be left blank | |
49 | * to indicate any type. | |
50 | */ | |
51 | void setType(String value); | |
52 | ||
53 | /** | |
54 | * Returns the documentation for this parameter. | |
55 | * | |
56 | * @since 1.0.9 | |
57 | */ | |
58 | String getDescription(); | |
59 | ||
60 | /** | |
61 | * Sets the documentation for this parameter. | |
62 | * | |
63 | * @since 1.0.9 | |
64 | */ | |
65 | void setDescription(String description); | |
66 | ||
67 | /** | |
68 | * Sets the property name (of the component class) to connect the parameter | |
69 | * to. | |
70 | */ | |
71 | void setPropertyName(String propertyName); | |
72 | ||
73 | /** | |
74 | * Returns the name of the JavaBeans property to connect the parameter to. | |
75 | */ | |
76 | String getPropertyName(); | |
77 | ||
78 | /** | |
79 | * Returns the default value for the parameter (or null if the parameter has | |
80 | * no default value). Required parameters may not have a default value. The | |
81 | * default value is a <em>binding locator</em> (a prefixed value, as with | |
82 | * a binding element). | |
83 | */ | |
84 | String getDefaultValue(); | |
85 | ||
86 | /** | |
87 | * Sets the default value of the JavaBeans property if no binding is | |
88 | * provided. | |
89 | */ | |
90 | void setDefaultValue(String defaultValue); | |
91 | ||
92 | /** | |
93 | * Returns true if the parameter property should cache the result of the | |
94 | * binding. | |
95 | * | |
96 | * @since 4.0 | |
97 | */ | |
98 | ||
99 | boolean getCache(); | |
100 | ||
101 | /** @since 4.0 */ | |
102 | ||
103 | void setCache(boolean cache); | |
104 | ||
105 | /** | |
106 | * Returns the (primary) name of the parameter. | |
107 | * | |
108 | * @since 4.0 | |
109 | */ | |
110 | ||
111 | String getParameterName(); | |
112 | ||
113 | /** | |
114 | * @since 4.0 | |
115 | */ | |
116 | ||
117 | void setParameterName(String name); | |
118 | ||
119 | /** | |
120 | * Returns a non-null collection of strings for the aliases of the | |
121 | * parameter. This is usually an empty list. | |
122 | * | |
123 | * @since 4.0 | |
124 | */ | |
125 | ||
126 | Collection getAliasNames(); | |
127 | ||
128 | /** | |
129 | * Sets the list of aliases as a comma-seperated list. | |
130 | * | |
131 | * @param nameList | |
132 | * a comma seperated list of names, which may be null or empty | |
133 | * @since 4.0 | |
134 | */ | |
135 | ||
136 | void setAliases(String nameList); | |
137 | ||
138 | /** | |
139 | * Returns true if the parameter is deprecated. Deprecated parameter | |
140 | * generate a warning when bound. | |
141 | * | |
142 | * @since 4.0 | |
143 | */ | |
144 | ||
145 | boolean isDeprecated(); | |
146 | ||
147 | /** | |
148 | * @since 4.0 | |
149 | */ | |
150 | ||
151 | void setDeprecated(boolean deprecated); | |
152 | ||
153 | } |