|
|||||||||||||||||||
30 day Evaluation License registered to hlship@comcast.net Your 30 day evaluation period has expired. Please visit http://www.cenqua.com to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ValidatableField.java | - | - | - | - |
|
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.form; | |
16 | ||
17 | import org.apache.tapestry.IMarkupWriter; | |
18 | import org.apache.tapestry.IRequestCycle; | |
19 | import org.apache.tapestry.form.translator.Translator; | |
20 | ||
21 | /** | |
22 | * Implemented by form components that can need to be translated and validated. During render the | |
23 | * translator is used to translated the value to a string. During rewind, the submitted value is | |
24 | * translated back into an object by the translator and then validated. | |
25 | * | |
26 | * @author Paul Ferraro | |
27 | * @since 4.0 | |
28 | */ | |
29 | public interface ValidatableField extends IFormComponent | |
30 | { | |
31 | /** | |
32 | * Coerced into an Iterator of Validators | |
33 | */ | |
34 | public Object getValidators(); | |
35 | ||
36 | /** | |
37 | * The Translator implementation used by this field. | |
38 | */ | |
39 | public Translator getTranslator(); | |
40 | ||
41 | /** | |
42 | * Renders this form component using the specified value. | |
43 | */ | |
44 | public void render(IMarkupWriter writer, IRequestCycle cycle, String value); | |
45 | ||
46 | /** | |
47 | * Called during rewind to bind the successfully translated and validated value to the | |
48 | * appropriate component parameter. | |
49 | */ | |
50 | public void writeValue(Object value); | |
51 | ||
52 | /** | |
53 | * Called during render to read the parameter that drives the value of is form component. | |
54 | */ | |
55 | public Object readValue(); | |
56 | } |
|