|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ValidatorFactory | Line # 18 | 22 | 0% | 13 | 9 | 76.3% |
0.7631579
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
(100) | |||
Result | |||
0.57894737
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.13157895
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
0.02631579
|
$testMethod.qualifiedName $testMethod.qualifiedName | 1 PASS | |
1 | package org.kuali.student.common.validator; | |
2 | ||
3 | import java.util.ArrayList; | |
4 | import java.util.HashMap; | |
5 | import java.util.List; | |
6 | import java.util.Map; | |
7 | ||
8 | import org.apache.log4j.Logger; | |
9 | ||
10 | /** | |
11 | * ValidatorFactory provides a mechanism to | |
12 | * | |
13 | * | |
14 | * @author Kuali Rice Team (kuali-rice@googlegroups.com) | |
15 | * | |
16 | */ | |
17 | ||
18 | public class ValidatorFactory { | |
19 | private static final Logger LOG = Logger.getLogger(ValidatorFactory.class); | |
20 | private Map<String,Validator> customValidators = null; | |
21 | private DefaultValidatorImpl defaultValidator; | |
22 | ||
23 | private List<Validator> validatorList = new ArrayList<Validator>(); | |
24 | ||
25 | 20 | public ValidatorFactory(){ |
26 | } | |
27 | ||
28 | 1 | public synchronized void initializeMap(){ |
29 | ||
30 | 1 | if(null == customValidators) { |
31 | 1 | customValidators = new HashMap<String, Validator>(); |
32 | 1 | for(Validator validator: validatorList){ |
33 | 3 | String validatorName = validator.getClass().getName(); |
34 | 3 | customValidators.put(validatorName, validator); |
35 | } | |
36 | ||
37 | } | |
38 | } | |
39 | ||
40 | ||
41 | 21 | public Validator getValidator(String customValidator) { |
42 | ||
43 | 21 | LOG.info("Retrieving validatior:" + customValidator); |
44 | 21 | if(null == customValidators) { |
45 | 1 | initializeMap(); |
46 | } | |
47 | ||
48 | 21 | Validator v = customValidators.get(customValidator); |
49 | ||
50 | 21 | if(v != null && v instanceof BaseAbstractValidator) { |
51 | 21 | BaseAbstractValidator bv = (BaseAbstractValidator)v; |
52 | 21 | bv.setValidatorFactory(this); |
53 | 21 | return bv; |
54 | } else { | |
55 | 0 | return v; |
56 | } | |
57 | } | |
58 | ||
59 | 2095 | public Validator getValidator(){ |
60 | 2095 | if(defaultValidator==null){ |
61 | 0 | defaultValidator = new DefaultValidatorImpl(); |
62 | } | |
63 | ||
64 | 2095 | defaultValidator.setValidatorFactory(this); |
65 | 2095 | return defaultValidator; |
66 | } | |
67 | ||
68 | 0 | public DefaultValidatorImpl getDefaultValidator() { |
69 | 0 | return defaultValidator; |
70 | } | |
71 | ||
72 | 18 | public void setDefaultValidator(DefaultValidatorImpl defaultValidator) { |
73 | 18 | this.defaultValidator = defaultValidator; |
74 | } | |
75 | ||
76 | 0 | public List<Validator> getValidatorList() { |
77 | 0 | return validatorList; |
78 | } | |
79 | ||
80 | 1 | public void setValidatorList(List<Validator> validatorList) { |
81 | 1 | this.validatorList = validatorList; |
82 | } | |
83 | } |
|