Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ValidatableFieldExtension |
|
| 1.0;1 |
1 | // Copyright Aug 6, 2006 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 | package org.apache.tapestry.form; | |
15 | ||
16 | import org.apache.tapestry.IMarkupWriter; | |
17 | import org.apache.tapestry.IRequestCycle; | |
18 | import org.apache.tapestry.form.validator.Validator; | |
19 | ||
20 | ||
21 | /** | |
22 | * Marker interface for components that would like to override the default | |
23 | * logic used to render validation contributions made for client side form | |
24 | * validation. | |
25 | * | |
26 | * @author jkuhnert | |
27 | */ | |
28 | public interface ValidatableFieldExtension extends ValidatableField | |
29 | { | |
30 | ||
31 | /**Called during render of the specified component. Renders any contributions from validators. | |
32 | * Check to see if this field would like to override the default | |
33 | * contributions made by the specified {@link Validator} with it's own | |
34 | * contributions. | |
35 | * | |
36 | * @param validator The validator to check if component wants to override. | |
37 | * @param cycle The current request cycle. | |
38 | * | |
39 | * @return True if this field wants to override default, false otherwise. | |
40 | */ | |
41 | boolean overrideValidator(Validator validator, IRequestCycle cycle); | |
42 | ||
43 | /** | |
44 | * Very similar to the method signature used by {@link ValidatableFieldSupport#renderContributions(ValidatableField, IMarkupWriter, IRequestCycle)}, | |
45 | * with the additional parameter being the {@link Validator} that this component has chosen to override. | |
46 | * | |
47 | * <p> | |
48 | * This method will only be called if {@link #overrideValidator(Validator, IRequestCycle)} returns true | |
49 | * for the specified {@link Validator}. | |
50 | * </p> | |
51 | * | |
52 | * @param validator The original {@link Validator} that component opted to override. | |
53 | * @param context The context object used by validation contributors. | |
54 | * @param writer The markup writer to send content to. (if any is needed) | |
55 | * @param cycle The current request cycle. | |
56 | */ | |
57 | void overrideContributions(Validator validator, FormComponentContributorContext context, | |
58 | IMarkupWriter writer, IRequestCycle cycle); | |
59 | } |