1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
package org.apache.tapestry.form.validator; |
16 |
|
|
17 |
|
import org.apache.tapestry.IMarkupWriter; |
18 |
|
import org.apache.tapestry.IRequestCycle; |
19 |
|
import org.apache.tapestry.form.FormComponentContributorContext; |
20 |
|
import org.apache.tapestry.form.IFormComponent; |
21 |
|
import org.apache.tapestry.form.ValidationMessages; |
22 |
|
import org.apache.tapestry.valid.ValidatorException; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
6 |
public abstract class AbstractValidatorWrapper implements Validator |
32 |
|
{ |
33 |
|
protected abstract Validator getDelegate(); |
34 |
|
|
35 |
|
public void validate(IFormComponent field, ValidationMessages messages, Object object) |
36 |
|
throws ValidatorException |
37 |
|
{ |
38 |
2 |
getDelegate().validate(field, messages, object); |
39 |
2 |
} |
40 |
|
|
41 |
|
public boolean getAcceptsNull() |
42 |
|
{ |
43 |
3 |
return getDelegate().getAcceptsNull(); |
44 |
|
} |
45 |
|
|
46 |
|
public boolean isRequired() |
47 |
|
{ |
48 |
2 |
return getDelegate().isRequired(); |
49 |
|
} |
50 |
|
|
51 |
|
public void renderContribution(IMarkupWriter writer, IRequestCycle cycle, |
52 |
|
FormComponentContributorContext context, IFormComponent field) |
53 |
|
{ |
54 |
1 |
getDelegate().renderContribution(writer, cycle, context, field); |
55 |
1 |
} |
56 |
|
|
57 |
|
} |