public class XIncludeTextReader extends Object
XIncludeHandler
Constructor and Description |
---|
XIncludeTextReader(XMLInputSource source,
XIncludeHandler handler,
int bufferSize)
Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the stream.
|
protected String |
consumeBOM(InputStream stream,
String encoding)
Removes the byte order mark from the stream, if
it exists and returns the encoding name.
|
protected String |
getEncodingName(byte[] b4)
REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager.
|
protected String |
getEncodingName(InputStream stream)
XMLEntityManager cares about endian-ness, since it creates its own optimized
readers.
|
protected Reader |
getReader(XMLInputSource source)
Return the Reader for given XMLInputSource.
|
protected boolean |
isValid(int ch)
Returns true if the specified character is a valid XML character
as per the rules of XML 1.0.
|
void |
parse()
Read the input stream as text, and pass the text on to the XIncludeHandler
using calls to characters().
|
protected void |
setBufferSize(int bufferSize)
Sets the buffer size property for the reader which decides the chunk sizes that are parsed
by the reader at a time and passed to the handler
|
void |
setErrorReporter(XMLErrorReporter errorReporter)
Sets the XMLErrorReporter used for reporting errors while
reading the text include.
|
void |
setInputSource(XMLInputSource source)
Sets the input source on this text reader.
|
public XIncludeTextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize) throws IOException
source
- The XMLInputSource to use.handler
- The XIncludeHandler to use.bufferSize
- The size of this text reader's buffer.IOException
public void setErrorReporter(XMLErrorReporter errorReporter)
errorReporter
- the XMLErrorReporter to be used for
reporting errors.protected Reader getReader(XMLInputSource source) throws IOException
source
- The XMLInputSource to use.IOException
protected String getEncodingName(InputStream stream) throws IOException
IOException
protected String consumeBOM(InputStream stream, String encoding) throws IOException
stream
- encoding
- IOException
protected String getEncodingName(byte[] b4)
b4
- The first four bytes of the input.public void parse() throws IOException
IOException
public void setInputSource(XMLInputSource source)
source
- The XMLInputSource to use.public void close() throws IOException
IOException
protected boolean isValid(int ch)
ch
- The character to check.protected void setBufferSize(int bufferSize)
bufferSize
- The size of the buffer desiredCopyright © 2017 JBoss by Red Hat. All rights reserved.