KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > spec > IParameterSpecification


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 JavaDoc;
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 JavaDoc 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 JavaDoc value);
50
51     /**
52      * Returns the documentation for this parameter.
53      *
54      * @since 1.0.9
55      */

56     public String JavaDoc getDescription();
57
58     /**
59      * Sets the documentation for this parameter.
60      *
61      * @since 1.0.9
62      */

63     public void setDescription(String JavaDoc description);
64
65     /**
66      * Sets the property name (of the component class) to connect the parameter to.
67      */

68     public void setPropertyName(String JavaDoc propertyName);
69
70     /**
71      * Returns the name of the JavaBeans property to connect the parameter to.
72      */

73     public String JavaDoc 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 JavaDoc getDefaultValue();
81
82     /**
83      * Sets the default value of the JavaBeans property if no binding is provided
84      */

85     public void setDefaultValue(String JavaDoc defaultValue);
86
87     /**
88      * Sets the default binding type, used when a parameter is bound without specifying an explicit
89      * binding prefix. May be blank (null or empty string), in which case the default binding type
90      * is determined by whether the parameter is bound in an HTML template or in a page or component
91      * specification.
92      *
93      * @see org.apache.tapestry.binding.BindingConstants
94      * @see org.apache.tapestry.binding.BindingUtils#getDefaultBindingType(IComponentSpecification,
95      * String, String)
96      * @since 4.0
97      */

98
99     public void setDefaultBindingType(String JavaDoc bindingType);
100
101     /** @since 4.0 */
102     public String JavaDoc getDefaultBindingType();
103
104     /**
105      * Returns true if the parameter property should cache the result of the binding.
106      *
107      * @since 4.0
108      */

109
110     public boolean getCache();
111
112     /** @since 4.0 */
113
114     public void setCache(boolean cache);
115
116     /**
117      * Returns the (primary) name of the parameter.
118      *
119      * @since 4.0
120      */

121
122     public String JavaDoc getParameterName();
123
124     /**
125      * @since 4.0
126      */

127
128     public void setParameterName(String JavaDoc name);
129
130     /**
131      * Returns a non-null collection of strings for the aliases of the parameter. This is usually an
132      * empty list.
133      *
134      * @since 4.0
135      */

136
137     public Collection JavaDoc getAliasNames();
138
139     /**
140      * Sets the list of aliases as a comma-seperated list.
141      *
142      * @param nameList
143      * a comma seperated list of names, which may be null or empty
144      * @since 4.0
145      */

146
147     public void setAliases(String JavaDoc nameList);
148
149     /**
150      * Returns true if the parameter is deprecated. Deprecated parameter generate a warning when
151      * bound.
152      *
153      * @since 4.0
154      */

155
156     public boolean isDeprecated();
157
158     /**
159      * @since 4.0
160      */

161
162     public void setDeprecated(boolean deprecated);
163
164 }
Popular Tags