01 /*
02 * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package javax.xml.bind;
27
28 /**
29 * This event indicates that a problem was encountered while validating the
30 * incoming XML data during an unmarshal operation, while performing
31 * on-demand validation of the Java content tree, or while marshalling the
32 * Java content tree back to XML data.
33 *
34 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul>
35 * @version $Revision: 1.2 $
36 * @see Validator
37 * @see ValidationEventHandler
38 * @since JAXB1.0
39 */
40 public interface ValidationEvent {
41
42 /**
43 * Conditions that are not errors or fatal errors as defined by the
44 * XML 1.0 recommendation
45 */
46 public static final int WARNING = 0;
47
48 /**
49 * Conditions that correspond to the definition of "error" in section
50 * 1.2 of the W3C XML 1.0 Recommendation
51 */
52 public static final int ERROR = 1;
53
54 /**
55 * Conditions that correspond to the definition of "fatal error" in section
56 * 1.2 of the W3C XML 1.0 Recommendation
57 */
58 public static final int FATAL_ERROR = 2;
59
60 /**
61 * Retrieve the severity code for this warning/error.
62 *
63 * <p>
64 * Must be one of <tt>ValidationError.WARNING</tt>,
65 * <tt>ValidationError.ERROR</tt>, or <tt>ValidationError.FATAL_ERROR</tt>.
66 *
67 * @return the severity code for this warning/error
68 */
69 public int getSeverity();
70
71 /**
72 * Retrieve the text message for this warning/error.
73 *
74 * @return the text message for this warning/error or null if one wasn't set
75 */
76 public String getMessage();
77
78 /**
79 * Retrieve the linked exception for this warning/error.
80 *
81 * @return the linked exception for this warning/error or null if one
82 * wasn't set
83 */
84 public Throwable getLinkedException();
85
86 /**
87 * Retrieve the locator for this warning/error.
88 *
89 * @return the locator that indicates where the warning/error occurred
90 */
91 public ValidationEventLocator getLocator();
92
93 }
|