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