01: /*
02: * Copyright 2005-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
05: * in compliance with the License. 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 distributed under the License
10: * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11: * or implied. See the License for the specific language governing permissions and limitations under
12: * the License.
13: */
14:
15: package org.strecks.validator.internal;
16:
17: import java.util.List;
18:
19: import org.strecks.converter.Converter;
20: import org.strecks.util.Assert;
21:
22: /**
23: * Encapsulates the <code>Validators</code>, <code>Converter</code> and other state associated
24: * with the ability to validate a particular form property
25: * @author Phil Zoio
26: */
27: public class MethodValidators {
28:
29: private boolean requiresConversion;
30:
31: private OrderedProperty orderedProperty;
32:
33: private List<ValidatorWrapper> validators;
34:
35: private Converter converter;
36:
37: private Class<?> converterType;
38:
39: public MethodValidators(OrderedProperty orderedProperty,
40: List<ValidatorWrapper> typedValidators,
41: Converter converter, boolean requiresConversion,
42: Class<?> converterType) {
43: super ();
44: Assert.notNull(orderedProperty);
45: Assert.notNull(typedValidators);
46: this .orderedProperty = orderedProperty;
47: this .validators = typedValidators;
48: this .converter = converter;
49: this .requiresConversion = requiresConversion;
50: this .converterType = converterType;
51:
52: }
53:
54: public OrderedProperty getOrderedProperty() {
55: return orderedProperty;
56: }
57:
58: public List<ValidatorWrapper> getValidators() {
59: return validators;
60: }
61:
62: public Converter getConverter() {
63: return converter;
64: }
65:
66: public boolean getRequiresConversion() {
67: return requiresConversion;
68: }
69:
70: public Class getConverterType() {
71: return converterType;
72: }
73:
74: }
|