net.n3.nanoxml
public class StdXMLReader extends Object implements IXMLReader
Version: $Name: RELEASE_2_2_1 $, $Revision: 1.4 $
Constructor Summary | |
---|---|
StdXMLReader(String publicID, String systemID)
Initializes the reader from a system and public ID.
| |
StdXMLReader(Reader reader)
Initializes the XML reader.
| |
StdXMLReader(InputStream stream)
Initializes the XML reader.
|
Method Summary | |
---|---|
boolean | atEOF()
Returns true if there are no more characters left to be read.
|
boolean | atEOFOfCurrentStream()
Returns true if the current stream has no more characters left to be
read.
|
static IXMLReader | fileReader(String filename)
Creates a new reader using a file as input.
|
protected void | finalize()
Cleans up the object when it's destroyed. |
protected String | getEncoding(String str)
Scans the encoding from an <? |
int | getLineNr()
Returns the line number of the data in the current stream. |
String | getPublicID()
Returns the current public ID. |
int | getStreamLevel()
Returns the current "level" of the stream on the stack of streams. |
String | getSystemID()
Returns the current system ID. |
Reader | openStream(String publicID, String systemID)
Opens a stream from a public and system ID.
|
char | read()
Reads a character.
|
void | setPublicID(String publicID)
Sets the public ID of the current stream.
|
void | setSystemID(String systemID)
Sets the system ID of the current stream.
|
void | startNewStream(Reader reader)
Starts a new stream from a Java reader. |
void | startNewStream(Reader reader, boolean isInternalEntity)
Starts a new stream from a Java reader. |
protected Reader | stream2reader(InputStream stream, StringBuffer charsRead)
Converts a stream to a reader while detecting the encoding.
|
static IXMLReader | stringReader(String str)
Creates a new reader using a string as input.
|
void | unread(char ch)
Pushes the last character read back to the stream.
|
Parameters: publicID the public ID which may be null. systemID the non-null system ID.
Throws: MalformedURLException if the system ID does not contain a valid URL FileNotFoundException if the system ID refers to a local file which does not exist IOException if an error occurred opening the stream
Parameters: reader the input for the XML data.
Parameters: stream the input for the XML data.
Throws: java.io.IOException if an I/O error occurred
Throws: java.io.IOException if an I/O error occurred
Throws: java.io.IOException if an I/O error occurred
Parameters: filename the name of the file containing the XML data
Throws: java.io.FileNotFoundException if the file could not be found java.io.IOException if an I/O error occurred
Parameters: str the first tag in the XML data.
Returns: the encoding, or null if no encoding has been specified.
Parameters: publicID the public ID, which may be null systemID the system ID, which is never null
Throws: java.net.MalformedURLException if the system ID does not contain a valid URL java.io.FileNotFoundException if the system ID refers to a local file which does not exist java.io.IOException if an error occurred opening the stream
Returns: the character
Throws: java.io.IOException if no character could be read
Parameters: publicID the public ID
Parameters: systemID the system ID
Throws: java.net.MalformedURLException if the system ID does not contain a valid URL
Parameters: reader the non-null reader to read the new data from
Parameters: reader the non-null reader to read the new data from isInternalEntity true if the reader is produced by resolving an internal entity
Parameters: stream the input for the XML data. charsRead buffer where to put characters that have been read
Throws: java.io.IOException if an I/O error occurred
Parameters: str the string containing the XML data
Parameters: ch the character to push back.
Throws: java.io.IOException if an I/O error occurred