1 /* 2 * @(#)XmlReader.java 1.3 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package javax.sql.rowset.spi; 9 10 import java.sql.SQLException; 11 import java.io.Reader; 12 13 import javax.sql.RowSetReader; 14 import javax.sql.rowset.*; 15 16 /** 17 * A specialized interface that facilitates an extension of the 18 * <code>SyncProvider</code> abstract class for XML orientated 19 * synchronization providers. 20 * <P> 21 * <code>SyncProvider</code> implementations that supply XML data reader 22 * capabilities such as output XML stream capabilities can implement this 23 * interface to provider standard <code>XmlReader</code> objects to 24 * <code>WebRowSet</code> implementations. 25 * <p> 26 * An <code>XmlReader</code> object is registered as the 27 * XML reader for a <code>WebRowSet</code> by being assigned to the 28 * rowset's <code>xmlReader</code> field. When the <code>WebRowSet</code> 29 * object's <code>readXml</code> method is invoked, it in turn invokes 30 * its XML reader's <code>readXML</code> method. 31 */ 32 public interface XmlReader extends RowSetReader { 33 34 /** 35 * Reads and parses the given <code>WebRowSet</code> object from the given 36 * input stream in XML format. The <code>xmlReader</code> field of the 37 * given <code>WebRowSet</code> object must contain this 38 * <code>XmlReader</code> object. 39 * <P> 40 * If a parsing error occurs, the exception that is thrown will 41 * include information about the location of the error in the 42 * original XML document. 43 * 44 * @param caller the <code>WebRowSet</code> object to be parsed, whose 45 * <code>xmlReader</code> field must contain a reference to 46 * this <code>XmlReader</code> object 47 * @param reader the <code>java.io.Reader</code> object from which 48 * <code>caller</code> will be read 49 * @throws SQLException if a database access error occurs or 50 * this <code>XmlReader</code> object is not the reader 51 * for the given rowset 52 */ 53 public void readXML(WebRowSet caller, java.io.Reader reader) 54 throws SQLException; 55 56 } 57