1 | |
package org.seasar.cubby.validator; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.List; |
5 | |
|
6 | |
public class PropertyValidationRule implements ValidationRule { |
7 | |
|
8 | |
private final String propertyName; |
9 | |
private String propertyNameKey; |
10 | 21 | private final List<Validator> validators = new ArrayList<Validator>(); |
11 | |
|
12 | |
public PropertyValidationRule(final String propertyName, final Validator... validators) { |
13 | 6 | this(propertyName, propertyName, validators); |
14 | 6 | } |
15 | |
|
16 | 21 | public PropertyValidationRule(final String propertyName, final String propertyNameKey, final Validator... validators) { |
17 | 21 | this.propertyName = propertyName; |
18 | 21 | this.propertyNameKey = propertyNameKey; |
19 | 47 | for (Validator v : validators) { |
20 | 26 | this.validators.add(v); |
21 | |
} |
22 | 21 | } |
23 | |
|
24 | |
public String getPropertyName() { |
25 | 17 | return propertyName; |
26 | |
} |
27 | |
|
28 | |
public String getPropertyNameKey() { |
29 | 14 | return propertyNameKey; |
30 | |
} |
31 | |
|
32 | |
public List<Validator> getValidators() { |
33 | 6 | return validators; |
34 | |
} |
35 | |
|
36 | |
} |