Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Class DocTypeReader  view DocTypeReader download

      extended bycom.ibatis.db.sqlmap.upgrade.DocTypeReader

public class DocTypeReader

This class strips the doctype from an XML stream because java.xml.transform can't disable validation and/or loading of the DTD in a standard way, which causes problems for those running without a network.

Line terminators are converted to a \n

Field Summary
private  java.lang.String docType
private reader
Fields inherited from class
Constructor Summary
DocTypeReader( in)
Method Summary
 void close()
          Closes the stream.
 java.lang.String getDocType()
 int read(char[] cbuf, int off, int len)
          Read chars from a stream and stores them into a caller supplied buffer.
Methods inherited from class
mark, markSupported, read, read, ready, reset, skip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private reader


private java.lang.String docType
Constructor Detail


public DocTypeReader( in)
Method Detail


public java.lang.String getDocType()


public int read(char[] cbuf,
                int off,
                int len)
Description copied from class:
Read chars from a stream and stores them into a caller supplied buffer. It starts storing the data at index offset into the buffer and attempts to read len chars. This method can return before reading the number of chars requested. The actual number of chars read is returned as an int. A -1 is returned to indicate the end of the stream.

This method will block until some data can be read.

This method operates by calling the single char read() method in a loop until the desired number of chars are read. The read loop stops short if the end of the stream is encountered or if an IOException is encountered on any read operation except the first. If the first attempt to read a chars fails, the IOException is allowed to propagate upward. And subsequent IOException is caught and treated identically to an end of stream condition. Subclasses can (and should if possible) override this method to provide a more efficient implementation.


public void close()
Description copied from class:
Closes the stream. Any futher attempts to read from the stream may generate an IOException.