001    /*
002     * $Id: ValidationEvent.java,v 1.9 2002/09/12 17:26:51 ryans Exp $
003     *
004     * Copyright 2001 Sun Microsystems, Inc. All Rights Reserved.
005     * 
006     * This software is the proprietary information of Sun Microsystems, Inc.  
007     * Use is subject to license terms.
008     * 
009     */
010    
011    package javax.xml.bind;
012    
013    /**
014     * This event indicates that a problem was encountered while validating the    
015     * incoming XML data during an unmarshal operation, while performing 
016     * on-demand validation of the Java content tree, or while marshalling the
017     * Java content tree back to XML data.
018     * 
019     * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 
020     * @version $Revision: 1.9 $
021     * @see Validator
022     * @see ValidationEventHandler
023     * @since JAXB1.0
024     */
025    public interface ValidationEvent {
026        
027        /** 
028         * Conditions that are not errors or fatal errors as defined by the 
029         * XML 1.0 recommendation 
030         */
031        public static final int WARNING     = 0;
032        
033        /**
034         * Conditions that correspond to the definition of "error" in section 
035         * 1.2 of the W3C XML 1.0 Recommendation
036         */
037        public static final int ERROR       = 1;
038        
039        /**
040         * Conditions that correspond to the definition of "fatal error" in section 
041         * 1.2 of the W3C XML 1.0 Recommendation
042         */
043        public static final int FATAL_ERROR = 2;
044    
045        /**
046         * Retrieve the severity code for this warning/error. 
047         *
048         * <p>
049         * Must be one of <tt>ValidationError.WARNING</tt>, 
050         * <tt>ValidationError.ERROR</tt>, or <tt>ValidationError.FATAL_ERROR</tt>.
051         *
052         * @return the severity code for this warning/error
053         */
054        public int getSeverity();
055        
056        /**
057         * Retrieve the text message for this warning/error.
058         *
059         * @return the text message for this warning/error or null if one wasn't set
060         */
061        public String getMessage();
062        
063        /**
064         * Retrieve the linked exception for this warning/error.
065         *
066         * @return the linked exception for this warning/error or null if one
067         *         wasn't set
068         */
069        public Throwable getLinkedException();
070        
071        /**
072         * Retrieve the locator for this warning/error.
073         *
074         * @return the locator that indicates where the warning/error occurred
075         */
076        public ValidationEventLocator getLocator();
077        
078    }