|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
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 org.apache.hivemind.LocationHolder;
|
|
18 |
|
|
19 |
/**
|
|
20 |
* Defines a formal parameter to a component. An <code>IParameterSpecification</code> is contained
|
|
21 |
* by a {@link IComponentSpecification}.
|
|
22 |
* <p>
|
|
23 |
* TBD: Identify arrays in some way.
|
|
24 |
*
|
|
25 |
* @author glongman@intelligentworks.com
|
|
26 |
*/
|
|
27 |
public interface IParameterSpecification extends LocationHolder |
|
28 |
{ |
|
29 |
/**
|
|
30 |
* Returns the class name of the expected type of the parameter. The default value is
|
|
31 |
* <code>java.lang.Object</code> which matches anything.
|
|
32 |
*/
|
|
33 |
public String getType();
|
|
34 |
|
|
35 |
/**
|
|
36 |
* Returns true if the parameter is required by the component. The default is false, meaning the
|
|
37 |
* parameter is optional.
|
|
38 |
*/
|
|
39 |
public boolean isRequired(); |
|
40 |
|
|
41 |
public void setRequired(boolean value); |
|
42 |
|
|
43 |
/**
|
|
44 |
* Sets the type of value expected for the parameter. This can be left blank to indicate any
|
|
45 |
* type.
|
|
46 |
*/
|
|
47 |
public void setType(String value); |
|
48 |
|
|
49 |
/**
|
|
50 |
* Returns the documentation for this parameter.
|
|
51 |
*
|
|
52 |
* @since 1.0.9
|
|
53 |
*/
|
|
54 |
public String getDescription();
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Sets the documentation for this parameter.
|
|
58 |
*
|
|
59 |
* @since 1.0.9
|
|
60 |
*/
|
|
61 |
public void setDescription(String description); |
|
62 |
|
|
63 |
/**
|
|
64 |
* Sets the property name (of the component class) to connect the parameter to.
|
|
65 |
*/
|
|
66 |
public void setPropertyName(String propertyName); |
|
67 |
|
|
68 |
/**
|
|
69 |
* Returns the name of the JavaBeans property to connect the parameter to.
|
|
70 |
*/
|
|
71 |
public String getPropertyName();
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Returns the default value for the parameter (or null if the parameter has no default value).
|
|
75 |
* Required parameters may not have a default value. The default value is a
|
|
76 |
* <em>binding locator</em>(a prefixed value, as with a binding element).
|
|
77 |
*/
|
|
78 |
public String getDefaultValue();
|
|
79 |
|
|
80 |
/**
|
|
81 |
* Sets the default value of the JavaBeans property if no binding is provided
|
|
82 |
*/
|
|
83 |
public void setDefaultValue(String defaultValue); |
|
84 |
|
|
85 |
/**
|
|
86 |
* Sets the default binding type, used when a parameter is bound without specifying an explicit
|
|
87 |
* binding prefix. May be null, in which case the default binding type is determined by whether
|
|
88 |
* the parameter is bound in an HTML template or in a page or component specification.
|
|
89 |
*
|
|
90 |
* @see org.apache.tapestry.binding.BindingConstants
|
|
91 |
* @see org.apache.tapestry.binding.BindingUtils#getDefaultBindingType(IComponentSpecification,
|
|
92 |
* String, String)
|
|
93 |
* @since 4.0
|
|
94 |
*/
|
|
95 |
|
|
96 |
public void setDefaultBindingType(String bindingType); |
|
97 |
|
|
98 |
/** @since 4.0 */
|
|
99 |
public String getDefaultBindingType();
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Returns true if the parameter proeprty should cache the result of the binding.
|
|
103 |
*
|
|
104 |
* @since 4.0
|
|
105 |
*/
|
|
106 |
|
|
107 |
public boolean getCache(); |
|
108 |
|
|
109 |
/** @since 4.0 */
|
|
110 |
|
|
111 |
public void setCache(boolean cache); |
|
112 |
|
|
113 |
} |
|