org.dom4j.jaxb
public class JAXBModifier extends JAXBSupport
See Also: SAXModifier
Constructor Summary | |
---|---|
JAXBModifier(String contextPath)
Creates a new JAXBModifier for the given JAXB context path. | |
JAXBModifier(String contextPath, ClassLoader classloader)
Creates a new JAXBModifier for the given JAXB context path, using the
given java.lang.ClassLoader. | |
JAXBModifier(String contextPath, OutputFormat outputFormat)
Creates a new JAXBModifier for the given JAXB context path. | |
JAXBModifier(String contextPath, ClassLoader classloader, OutputFormat outputFormat)
Creates a new JAXBModifier for the given JAXB context path, using the
specified java.lang.Classloader. |
Method Summary | |
---|---|
void | addObjectModifier(String path, JAXBObjectModifier mod)
Adds the JAXBObjectModifierto be called when the specified xml
path is encounted while parsing the source.
|
boolean | isPruneElements()
Returns true when the modified Documentis not kept in
memory.
|
Document | modify(File source)
Parses the specified java.io.Filewith SAX
|
Document | modify(File source, Charset charset)
Parses the specified java.io.Filewith SAX, using the given
java.nio.charset.Charset.
|
Document | modify(InputSource source)
Parses the specified org.xml.sax.InputSourcewith SAX.
|
Document | modify(InputStream source)
Parses the specified java.io.InputStreamwith SAX.
|
Document | modify(InputStream source, String systemId)
Parses the specified java.io.InputStreamwith SAX.
|
Document | modify(Reader r)
Parses the specified java.io.Readerwith SAX.
|
Document | modify(Reader source, String systemId)
Parses the specified java.io.Readerwith SAX.
|
Document | modify(String url)
Parses the the given URL or filename.
|
Document | modify(URL source)
Parses the the given URL.
|
void | removeObjectModifier(String path)
Removes the JAXBObjectModifierfrom the event based processor,
for the specified element path.
|
void | resetObjectModifiers()
Removes all registered JAXBObjectModifierinstances from the
event based processor. |
void | setOutput(File file)
Sets the Output to write the (modified) xml document to.
|
void | setOutput(OutputStream outputStream)
Sets the Output to write the (modified) xml document to.
|
void | setOutput(Writer writer)
Sets the Output to write the (modified) xml document to.
|
void | setPruneElements(boolean pruneElements)
Define whether the modified Documentmust only be
written to the output and pruned from the DOM4J tree.
|
Parameters: contextPath JAXB context path to be used
See Also: javax.xml.bind.JAXBContext
Parameters: contextPath JAXB context path to be used classloader the classloader to use
See Also: javax.xml.bind.JAXBContext
Parameters: contextPath JAXB context path to be used outputFormat the DOM4J OutputFormatto be used
See Also: javax.xml.bind.JAXBContext
Parameters: contextPath JAXB context path to be used classloader the class loader to be used to load JAXB outputFormat the DOM4J OutputFormatto be used
See Also: javax.xml.bind.JAXBContext
Parameters: path the element path to listen for mod the modifier to register
Returns: Returns true if elements are pruned.
Parameters: source the file to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the file to parse charset the character set to use
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the input source to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the inputstream to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the inputstream to parse systemId the URI of the given inputstream
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: r the reader to use for parsing
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the reader to parse systemId the URI of the given reader
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: url the URL or filename to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: source the URL to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing IOException when an error occurs while writing to the XMLWriter
Parameters: path the xml path to remove the modifier for
Parameters: file the java.io.Fileto write to
Throws: IOException when the file cannot be found or when the outputformat
Parameters: outputStream the java.io.OutputStreamto write to
Throws: IOException when an error occurs
Parameters: writer the java.io.Writerto write to
Throws: IOException when an error occurs
Parameters: pruneElements When true, elements will not be kept in memory