1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.talika.tarsis.filters.validator;
24
25 import java.util.Collection;
26 import java.util.Map;
27 import java.util.Collections;
28
29 import org.talika.tarsis.error.UserException;
30
31 /**
32 * Thrown by <code>ValidatorFilter</code> to transport all invalid parameter
33 * exceptions as one unique exception.
34 *
35 * @author Jose M. Palomar
36 * @version $Revision: 129 $
37 */
38 public class InvalidParametersException extends UserException {
39
40
41 /**
42 * Collection of <code>RequiredParameterException</code> exceptions.
43 */
44 private Collection missingParameters;
45
46 /**
47 * Map of <code>InvalidValueException</code> exceptions.
48 */
49 private Map invalidValueParameters;
50
51
52 /**
53 * Constructs a new <code>InvalidParametersException</code> exception.
54 *
55 * @param msg String text of the exception message.
56 * @param missingParameters Collection <code>RequiredParameterException</code>
57 * exceptions.
58 * @param invalidValueParameters Map <code>InvalidValueException</code>
59 * exceptions.
60 */
61 public InvalidParametersException(String msg, Collection missingParameters,
62 Map invalidValueParameters) {
63 super(msg);
64 this.missingParameters = missingParameters;
65 this.invalidValueParameters = invalidValueParameters;
66 }
67
68
69 /**
70 * Returns a collection of <code>RequiredParameterException</code> exceptions.
71 *
72 * @return Collection <code>RequiredParameterException</code> exceptions.
73 */
74 public Collection getMissingParameters() {
75 return Collections.unmodifiableCollection(missingParameters);
76 }
77
78 /**
79 * Returns a map of <code>InvalidValueException</code> exceptions.
80 *
81 * @return Map <code>InvalidValueException</code> exceptions.
82 */
83 public Map getInvalidValueParameters() {
84 return Collections.unmodifiableMap(invalidValueParameters);
85 }
86
87 }