001 /* 002 * $Id: ValidationEventLocator.java,v 1.3 2002/09/05 15:56:58 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 * Encapsulate the location of a ValidationEvent. 015 * 016 * <p> 017 * The <tt>ValidationEventLocator</tt> indicates where the <tt>ValidationEvent 018 * </tt> occurred. Different fields will be set depending on the type of 019 * validation that was being performed when the error or warning was detected. 020 * For example, on-demand validation would produce locators that contained 021 * references to objects in the Java content tree while unmarshal-time 022 * validation would produce locators containing information appropriate to the 023 * source of the XML data (file, url, Node, etc). 024 * 025 * @author <ul><li>Ryan Shoemaker, Sun Microsystems, Inc.</li><li>Kohsuke Kawaguchi, Sun Microsystems, Inc.</li><li>Joe Fialli, Sun Microsystems, Inc.</li></ul> 026 * @version $Revision: 1.3 $ 027 * @see Validator 028 * @see ValidationEvent 029 * @since JAXB1.0 030 */ 031 public interface ValidationEventLocator { 032 033 /** 034 * Return the name of the XML source as a URL if available 035 * 036 * @return the name of the XML source as a URL or null if unavailable 037 */ 038 public java.net.URL getURL(); 039 040 /** 041 * Return the byte offset if available 042 * 043 * @return the byte offset into the input source or -1 if unavailable 044 */ 045 public int getOffset(); 046 047 /** 048 * Return the line number if available 049 * 050 * @return the line number or -1 if unavailable 051 */ 052 public int getLineNumber(); 053 054 /** 055 * Return the column number if available 056 * 057 * @return the column number or -1 if unavailable 058 */ 059 public int getColumnNumber(); 060 061 /** 062 * Return a reference to the object in the Java content tree if available 063 * 064 * @return a reference to the object in the Java content tree or null if 065 * unavailable 066 */ 067 public java.lang.Object getObject(); 068 069 /** 070 * Return a reference to the DOM Node if available 071 * 072 * @return a reference to the DOM Node or null if unavailable 073 */ 074 public org.w3c.dom.Node getNode(); 075 076 }