XIncludeHandler
| Modifier and Type | Field and Description |
|---|---|
| private XMLErrorReporter | |
| private final XIncludeHandler | |
| private Reader | |
| private XMLInputSource | |
| private XMLString |
| Access | Constructor and Description |
|---|---|
| public | XIncludeTextReader(XMLInputSource
The XMLInputSource to use. source, XIncludeHandler The XIncludeHandler to use. handler, int The size of this text reader's buffer. bufferSize)Construct the XIncludeReader using the XMLInputSource and XIncludeHandler. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| protected String | consumeBOM(InputStream stream, String encoding)
Removes the byte order mark from the stream, if it exists and returns the encoding name. |
| private Reader | |
| private Reader | |
| private Reader | createUTF16Reader(InputStream stream, boolean isBigEndian)
Create a new UTF-16 reader from the InputStream. |
| private Reader | |
| protected String | getEncodingName(InputStream stream)
XMLEntityManager cares about endian-ness, since it creates its own optimized readers. |
| protected String | Returns: the encoding name, or null if no encoding could be detectedThe first four bytes of the input. b4)REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager. |
| protected Reader | getReader(XMLInputSource
The XMLInputSource to use. source)Return the Reader for given XMLInputSource. |
| protected boolean | isValid(int
The character to check. ch)Returns true if the specified character is a valid XML character as per the rules of XML 1.0. |
| public void | parse()
Read the input stream as text, and pass the text on to the XIncludeHandler using calls to characters(). |
| protected void | setBufferSize(int
The size of the buffer desired 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 |
| public void | setErrorReporter(XMLErrorReporter
the XMLErrorReporter to be used for
reporting errors. errorReporter)Sets the XMLErrorReporter used for reporting errors while reading the text include. |
| public void | setInputSource(XMLInputSource
The XMLInputSource to use. source)Sets the input source on this text reader. |
| fErrorReporter | back to summary |
|---|---|
| private XMLErrorReporter fErrorReporter | |
| fHandler | back to summary |
|---|---|
| private final XIncludeHandler fHandler | |
| fReader | back to summary |
|---|---|
| private Reader fReader | |
| fSource | back to summary |
|---|---|
| private XMLInputSource fSource | |
| fTempString | back to summary |
|---|---|
| private XMLString fTempString | |
| XIncludeTextReader | back to summary |
|---|---|
| public XIncludeTextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize) throws IOException Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Closes the stream. Call this after parse(), or when there is no longer any need for this object. | |
| consumeBOM | back to summary |
|---|---|
| protected String consumeBOM(InputStream stream, String encoding) throws IOException Removes the byte order mark from the stream, if it exists and returns the encoding name. | |
| createASCIIReader | back to summary |
|---|---|
| private Reader createASCIIReader(InputStream stream) Create a new ASCII reader from the InputStream. | |
| createLatin1Reader | back to summary |
|---|---|
| private Reader createLatin1Reader(InputStream stream) Create a new ISO-8859-1 reader from the InputStream. | |
| createUTF16Reader | back to summary |
|---|---|
| private Reader createUTF16Reader(InputStream stream, boolean isBigEndian) Create a new UTF-16 reader from the InputStream. | |
| createUTF8Reader | back to summary |
|---|---|
| private Reader createUTF8Reader(InputStream stream) Create a new UTF-8 reader from the InputStream. | |
| getEncodingName | back to summary |
|---|---|
| protected String getEncodingName(InputStream stream) throws 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 | |
| getEncodingName | back to summary |
|---|---|
| protected String getEncodingName(byte[] b4) 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.
| |
| getReader | back to summary |
|---|---|
| protected Reader getReader(XMLInputSource source) throws IOException Return the Reader for given XMLInputSource.
| |
| isValid | back to summary |
|---|---|
| protected boolean isValid(int ch) Returns true if the specified character is a valid XML character as per the rules of XML 1.0.
| |
| parse | back to summary |
|---|---|
| public void parse() throws 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. | |
| setBufferSize | back to summary |
|---|---|
| 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
| |
| setErrorReporter | back to summary |
|---|---|
| public void setErrorReporter(XMLErrorReporter errorReporter) Sets the XMLErrorReporter used for reporting errors while reading the text include.
| |
| setInputSource | back to summary |
|---|---|
| public void setInputSource(XMLInputSource source) Sets the input source on this text reader.
| |