
javax.xml.bind.ValidationEvent Maven / Gradle / Ivy
/*
* Copyright 2003, 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package javax.xml.bind;
/** An instance of ValidationEvent
indicates some
* error condition, which occurred when validating a JAXB object.
* The purpose of the {@link ValidationEventHandler} is to
* customize the reply on instances of ValidationEvent
.
* The default event handler will throw an exception in case of
* events, but application specific validation event handlers need
* not do the same.
*
* @see Validator
* @see ValidationEventHandler
* @since JAXB1.0
* @author JSR-31
*/
public interface ValidationEvent {
/** In contrast to errors or fatal errors, this indicates an
* event which can possibly be ignored. This constant has the
* value 0. See section 1.2 of the W3C XML 1.0 Recommendation for
* details.
* @see #ERROR
* @see #FATAL_ERROR
* @see #getSeverity()
*/
public static final int WARNING = 0;
/** This value indicates an "error", as specified by section
* 1.2 of the W3C XML 1.0 Recommendation. The constant value is
* 1.
* @see #WARNING
* @see #FATAL_ERROR
* @see #getSeverity()
*/
public static final int ERROR = 1;
/** This value indicates a "fatal error", as specified by section
* 1.2 of the W3C XML 1.0 Recommendation. The constant value is
* 2.
* @see #WARNING
* @see #ERROR
* @see #getSeverity()
*/
public static final int FATAL_ERROR = 2;
/** Returns the events severity: Either of
* {@link #WARNING}, {@link #ERROR}, or {@link #FATAL_ERROR}.
* @return Returns the events severity.
*/
public int getSeverity();
/** Returns a textual description of the event.
*/
public java.lang.String getMessage();
/** Returns a {@link Throwable} related to the event. In most cases
* an exception causing the event.
*/
public java.lang.Throwable getLinkedException();
/** Returns a description of the location, where the event
* occurred.
*/
public ValidationEventLocator getLocator();
}