Registered ElementModifierobjects can provide modifications to (part
of) the xml tree, while the document is still being processed. This makes it
possible to change large xml documents without having them in memory.
The modified document is written when the XMLWriteris specified.
org.dom4j.io.SAXReader , org.dom4j.io.XMLWriter
| Modifier and Type | Field and Description |
|---|---|
| private HashMap | |
| private SAXModifyReader | |
| private boolean | |
| private XMLReader | |
| private XMLWriter |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SAXModifier(boolean
Set to true when the modified document must NOT be kept in
memory. pruneElements)Creates a new modifier. |
| public | SAXModifier(XMLReader
The XMLReader to use xmlReader)Creates a new modifier that will the specified |
| public | SAXModifier(XMLReader
The XMLReader to use xmlReader, boolean Set to true when the modified document must NOT be kept in
memory. pruneElements)Creates a new modifier that will the specified |
| Modifier and Type | Method and Description |
|---|---|
| public void | addModifier(String
The element path to be handled path, ElementModifier The modifier)ElementModifierto be called by the event based
processor.Adds the |
| public DocumentFactory | Returns: DocumentFactory that will be usedGet the |
| private SAXModifyReader | |
| private XMLReader | |
| public XMLWriter | |
| private SAXReader | |
| public boolean | Returns: Returns the pruneElements.Returns true when xml elements are not kept in memory while parsing. |
| public Document | Returns: the newly created Document instanceis the source)File to read from.Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source)org.xml.sax.InputSource to read from.Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source)java.io.InputStream to read from.Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source, String java.io.InputStream to read from.DOCUMENT ME! systemId)Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source)java.io.Reader to read from.Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source, String java.io.Reader to read from.DOCUMENT ME! systemId)Reads a Document from the given |
| public Document | Returns: the newly created Document instanceis the source)java.net.URL to read from.Reads a Document from the given |
| public Document | |
| public void | removeModifier(String
The path to remove the path)ElementModifierfor.Removes the |
| public void | |
| public void | setDocumentFactory(DocumentFactory
DocumentFactory to be usedSets the |
| public void | setXMLWriter(XMLWriter
The writer to use. writer)Sets the |
| modifiers | back to summary |
|---|---|
| private HashMap<String, ElementModifier> modifiers | |
| modifyReader | back to summary |
|---|---|
| private SAXModifyReader modifyReader | |
| pruneElements | back to summary |
|---|---|
| private boolean pruneElements | |
| xmlReader | back to summary |
|---|---|
| private XMLReader xmlReader | |
| xmlWriter | back to summary |
|---|---|
| private XMLWriter xmlWriter | |
| SAXModifier | back to summary |
|---|---|
| public SAXModifier() Creates a new modifier. | |
| SAXModifier | back to summary |
|---|---|
| public SAXModifier(boolean pruneElements) Creates a new modifier.
| |
| SAXModifier | back to summary |
|---|---|
| public SAXModifier(XMLReader xmlReader) Creates a new modifier that will the specified
| |
| SAXModifier | back to summary |
|---|---|
| public SAXModifier(XMLReader xmlReader, boolean pruneElements) Creates a new modifier that will the specified
| |
| addModifier | back to summary |
|---|---|
| public void addModifier(String path, ElementModifier modifier) Adds the
| |
| getDocumentFactory | back to summary |
|---|---|
| public DocumentFactory getDocumentFactory() Get the
| |
| getSAXModifyReader | back to summary |
|---|---|
| private SAXModifyReader getSAXModifyReader() | |
| getXMLReader | back to summary |
|---|---|
| private XMLReader getXMLReader() throws SAXException | |
| getXMLWriter | back to summary |
|---|---|
| public XMLWriter getXMLWriter() Returns the current
| |
| installModifyReader | back to summary |
|---|---|
| private SAXReader installModifyReader() throws DocumentException | |
| isPruneElements | back to summary |
|---|---|
| public boolean isPruneElements() Returns true when xml elements are not kept in memory while parsing. The
| |
| modify | back to summary |
|---|---|
| public Document modify(File source) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(InputSource source) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(InputStream source) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(InputStream source, String systemId) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(Reader source) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(Reader source, String systemId) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(URL source) throws DocumentException Reads a Document from the given
| |
| modify | back to summary |
|---|---|
| public Document modify(String source) throws DocumentException Reads a Document from the given URL or filename and writes it to the
specified
| |
| removeModifier | back to summary |
|---|---|
| public void removeModifier(String path) Removes the
| |
| resetModifiers | back to summary |
|---|---|
| public void resetModifiers() Removes all registered | |
| setDocumentFactory | back to summary |
|---|---|
| public void setDocumentFactory(DocumentFactory factory) Sets the
| |
| setXMLWriter | back to summary |
|---|---|
| public void setXMLWriter(XMLWriter writer) Sets the
| |