Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TranslatedFieldSupport |
|
| 1.0;1 |
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.valid.ValidatorException; | |
20 | ||
21 | /** | |
22 | * | |
23 | */ | |
24 | public interface TranslatedFieldSupport | |
25 | { | |
26 | ||
27 | /** | |
28 | * Formats the field translation. | |
29 | * | |
30 | * @param field | |
31 | * The field the value is being formatted for. | |
32 | * @param object | |
33 | * The object value to be formatted. | |
34 | * | |
35 | * @return The formatted string value of the given object. | |
36 | */ | |
37 | String format(TranslatedField field, Object object); | |
38 | ||
39 | /** | |
40 | * Parses the field value. | |
41 | * @param field | |
42 | * The field to parse the value from. | |
43 | * @param text | |
44 | * The input text. | |
45 | * | |
46 | * @return The parsed field value in its translated object form. | |
47 | * @throws ValidatorException On validation error. | |
48 | */ | |
49 | Object parse(TranslatedField field, String text) | |
50 | throws ValidatorException; | |
51 | ||
52 | /** | |
53 | * Renders client side / misc contributions when the field is being rendered. | |
54 | * | |
55 | * @param field | |
56 | * The field being rendered. | |
57 | * @param writer | |
58 | * The markup writer to use. | |
59 | * @param cycle | |
60 | * The current request. | |
61 | */ | |
62 | void renderContributions(TranslatedField field, IMarkupWriter writer, IRequestCycle cycle); | |
63 | } |