java.lang.Object | |
↳ | org.apache.xerces.xinclude.XIncludeTextReader |
Known Direct Subclasses |
This class is used for reading resources requested in <include> elements, when the parse attribute of the <include> element is "text". Using this class will open the location, detect the encoding, and discard the byte order mark, if applicable. REVISIT: Much of the code in this class is taken from XMLEntityManager. It would be nice if this code could be shared in some way. However, since XMLEntityManager is used for reading files as XML, and this needs to read files as text, there would need to be some refactoring done.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the stream.
| |||||||||||
Read the input stream as text, and pass the text on to the XIncludeHandler
using calls to characters().
| |||||||||||
Sets the XMLErrorReporter used for reporting errors while
reading the text include.
| |||||||||||
Sets the input source on this text reader.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Removes the byte order mark from the stream, if
it exists and returns the encoding name.
| |||||||||||
XMLEntityManager cares about endian-ness, since it creates its own optimized
readers.
| |||||||||||
REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager.
| |||||||||||
Return the Reader for given XMLInputSource.
| |||||||||||
Returns true if the specified character is a valid XML character
as per the rules of XML 1.0.
| |||||||||||
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
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
source | The XMLInputSource to use. |
---|---|
handler | The XIncludeHandler to use. |
bufferSize | The size of this text reader's buffer. |
IOException |
---|
Closes the stream. Call this after parse(), or when there is no longer any need for this object.
IOException |
---|
Read the input stream as text, and pass the text on to the XIncludeHandler using calls to characters(). This will read all of the text it can from the resource.
IOException |
---|
Sets the XMLErrorReporter used for reporting errors while reading the text include.
errorReporter | the XMLErrorReporter to be used for reporting errors. |
---|
Sets the input source on this text reader.
source | The XMLInputSource to use. |
---|
Removes the byte order mark from the stream, if it exists and returns the encoding name.
IOException |
---|
XMLEntityManager cares about endian-ness, since it creates its own optimized readers. Since we're just using generic Java readers for now, we're not caring about endian-ness. If this changes, even more code needs to be copied from XMLEntity manager. -- PJM
IOException |
---|
REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager. Is there any way we can share the code, without having it implemented twice? I think we should make it public and static in XMLEntityManager. --PJM Returns the IANA encoding name that is auto-detected from the bytes specified, with the endian-ness of that encoding where appropriate.
b4 | The first four bytes of the input. |
---|
Return the Reader for given XMLInputSource.
source | The XMLInputSource to use. |
---|
IOException |
---|
Returns true if the specified character is a valid XML character as per the rules of XML 1.0.
ch | The character to check. |
---|
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
bufferSize | The size of the buffer desired |
---|