java.lang.Objectorg.xml.sax.InputSource
JDOMSource.JDOMInputSource
private static class JDOMSource.JDOMInputSource
A subclass of the SAX InputSource interface that wraps a JDOM Document.
This class is nested in JDOMSource as it is not intented to be used independently of its friend: DocumentReader.
Document
Field Summary | |
---|---|
private java.lang.Object |
source
The source as a JDOM document or a list of JDOM nodes. |
Constructor Summary | |
---|---|
JDOMSource.JDOMInputSource(Document document)
Builds a InputSource wrapping the specified JDOM Document. |
|
JDOMSource.JDOMInputSource(java.util.List nodes)
Builds a InputSource wrapping a list of JDOM nodes. |
Method Summary | |
---|---|
java.io.Reader |
getCharacterStream()
Gets the character stream for this input source. |
java.lang.Object |
getSource()
Returns the source. |
void |
setCharacterStream(java.io.Reader characterStream)
Sets the character stream for this input source. |
Methods inherited from class org.xml.sax.InputSource |
---|
getByteStream, getEncoding, getPublicId, getSystemId, setByteStream, setEncoding, setPublicId, setSystemId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.Object source
Constructor Detail |
---|
public JDOMSource.JDOMInputSource(Document document)
document
- the source document.public JDOMSource.JDOMInputSource(java.util.List nodes)
nodes
- the source JDOM nodes.Method Detail |
---|
public java.lang.Object getSource()
public void setCharacterStream(java.io.Reader characterStream) throws java.lang.UnsupportedOperationException
This implementation always throws an
UnsupportedOperationException
as the only source
stream supported is the source JDOM document.
setCharacterStream
in class org.xml.sax.InputSource
characterStream
- a character stream containing
an XML document.
java.lang.UnsupportedOperationException
- always!public java.io.Reader getCharacterStream()
Note that this method is only provided to make this InputSource implementation acceptable by any XML parser. As it generates an in-memory string representation of the JDOM document, it is quite inefficient from both speed and memory consumption points of view.
getCharacterStream
in class org.xml.sax.InputSource