Save This Page
Home » dom4j-1.6.1 » org.dom4j.io » [javadoc | source]
org.dom4j.io
public class: SAXModifier [javadoc | source]
java.lang.Object
   org.dom4j.io.SAXModifier
The SAXModifier reads, modifies and writes XML documents using SAX.

Registered ElementModifier objects 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 XMLWriter is specified.

Constructor:
 public SAXModifier() 
 public SAXModifier(boolean pruneElements) 
 public SAXModifier(XMLReader xmlReader) 
    Parameters:
    xmlReader - The XMLReader to use
 public SAXModifier(XMLReader xmlReader,
    boolean pruneElements) 
    Parameters:
    xmlReader - The XMLReader to use
    pruneElements - Set to true when the modified document must NOT be kept in memory.
Method from org.dom4j.io.SAXModifier Summary:
addModifier,   getDocumentFactory,   getXMLWriter,   isPruneElements,   modify,   modify,   modify,   modify,   modify,   modify,   modify,   modify,   removeModifier,   resetModifiers,   setDocumentFactory,   setXMLWriter
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.dom4j.io.SAXModifier Detail:
 public  void addModifier(String path,
    ElementModifier modifier) 
    Adds the ElementModifier to be called when the specified element path is encounted while parsing the source.
 public DocumentFactory getDocumentFactory() 
 public XMLWriter getXMLWriter() 
 public boolean isPruneElements() 
    Returns true when xml elements are not kept in memory while parsing. The org.dom4j.Document returned by the modify methods will be null.
 public Document modify(File source) throws DocumentException 
    Reads a Document from the given java.io.File and writes it to the specified XMLWriter using SAX. Registered {@linkElementModifier} objects are invoked on the fly.
 public Document modify(InputSource source) throws DocumentException 
 public Document modify(InputStream source) throws DocumentException 
 public Document modify(Reader source) throws DocumentException 
 public Document modify(URL source) throws DocumentException 
    Reads a Document from the given java.net.URL and writes it to the specified XMLWriter using SAX. Registered {@linkElementModifier} objects are invoked on the fly.
 public Document modify(String source) throws DocumentException 
    Reads a Document from the given URL or filename and writes it to the specified XMLWriter using SAX. Registered {@linkElementModifier} objects are invoked on the fly.
 public Document modify(InputStream source,
    String systemId) throws DocumentException 
 public Document modify(Reader source,
    String systemId) throws DocumentException 
 public  void removeModifier(String path) 
    Removes the ElementModifier from the event based processor, for the specified element path.
 public  void resetModifiers() 
    Removes all registered ElementModifier instances from the event based processor.
 public  void setDocumentFactory(DocumentFactory factory) 
 public  void setXMLWriter(XMLWriter writer) 
    Sets the XMLWriter used to write the modified document.