01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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;
16:
17: import org.apache.tapestry.dom.Element;
18:
19: /**
20: * An object responsible for performing decorations around fields and field labels. The decorator is
21: * notified at intervals by the fields and labels.
22: */
23: public interface ValidationDecorator {
24: /**
25: * Invoked after the label has rendered its tag, but before it has rendered content inside the
26: * tag, to allow the decorator to write additional attributes.
27: *
28: * @param field
29: * the field corresponding to the label
30: * @param labelElement
31: * the element for this label
32: */
33: void insideLabel(Field field, Element labelElement);
34:
35: /**
36: * Renders immediately before the field itself. The field will typically render a single
37: * element, though a complex field may render multiple elements or even some JavaScript.
38: *
39: * @param field
40: */
41: void beforeField(Field field);
42:
43: /**
44: * Invoked at a point where the decorator may write additional attributes into the field.
45: *
46: * @param field
47: */
48: void insideField(Field field);
49:
50: /** Invoked after the field has completed rendering itself. */
51: void afterField(Field field);
52: }
|