The SAXModifier reads, modifies and writes XML documents using SAX.
| Method from org.dom4j.io.SAXModifier Detail: |
public void addModifier(String path,
ElementModifier modifier) {
this.modifiers.put(path, modifier);
}
Adds the ElementModifier to be called when the specified element
path is encounted while parsing the source. |
public DocumentFactory getDocumentFactory() {
return getSAXModifyReader().getDocumentFactory();
}
|
public XMLWriter getXMLWriter() {
return this.xmlWriter;
}
|
public boolean isPruneElements() {
return pruneElements;
}
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 {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
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 {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
|
public Document modify(InputStream source) throws DocumentException {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
|
public Document modify(Reader source) throws DocumentException {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
|
public Document modify(URL source) throws DocumentException {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
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 {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
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 {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
|
public Document modify(Reader source,
String systemId) throws DocumentException {
try {
return installModifyReader().read(source);
} catch (SAXModifyException ex) {
Throwable cause = ex.getCause();
throw new DocumentException(cause.getMessage(), cause);
}
}
|
public void removeModifier(String path) {
this.modifiers.remove(path);
getSAXModifyReader().removeHandler(path);
}
Removes the ElementModifier from the event based processor, for
the specified element path. |
public void resetModifiers() {
this.modifiers.clear();
getSAXModifyReader().resetHandlers();
}
Removes all registered ElementModifier instances from the event
based processor. |
public void setDocumentFactory(DocumentFactory factory) {
getSAXModifyReader().setDocumentFactory(factory);
}
|
public void setXMLWriter(XMLWriter writer) {
this.xmlWriter = writer;
}
Sets the XMLWriter used to write the modified document. |