1 package org.apache.maven.j2ee;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 import java.util.EventObject;
21
22 /**
23 * A class that holds details about the validation
24 *
25 * @version $Id: ValidationEvent.java 170200 2005-05-15 06:24:19Z brett $
26 * @author dion
27 */
28 public class ValidationEvent extends EventObject
29 {
30
31 /** A message describing the validation event that occurred */
32 private String message;
33
34 /** The thing being validated that the event relates to, e.g a WAR file */
35 private Object subject;
36
37 /**
38 * Creates a new instance of ValidationEvent.
39 *
40 * @param source the source of the event, some validator.
41 */
42 public ValidationEvent(Object source)
43 {
44 this(source, null, null);
45 }
46
47 /**
48 * Creates a new instance of ValidationEvent.
49 *
50 * @param source the source of the event, some validator.
51 * @param subject the object being validated
52 * @param message the validation message
53 */
54 public ValidationEvent(Object source, Object subject, String message)
55 {
56 super(source);
57 setSubject(subject);
58 setMessage(message);
59 }
60
61 /**
62 * Getter for property message.
63 *
64 * @return Value of property message.
65 */
66 public String getMessage()
67 {
68 return message;
69 }
70
71 /**
72 * Setter for property message.
73 *
74 * @param message New value of property message.
75 */
76 public void setMessage(String message)
77 {
78 this.message = message;
79 }
80
81 /**
82 * Getter for property subject.
83 *
84 * @return Value of property subject.
85 */
86 public Object getSubject()
87 {
88 return subject;
89 }
90
91 /**
92 * Set the subject of the validation event.
93 *
94 * @param subject New value of property subject.
95 */
96 public void setSubject(Object subject)
97 {
98 this.subject = subject;
99 }
100
101 }