org.dom4j.jaxb
public class JAXBReader extends JAXBSupport
See Also: SAXReader javax.xml.bind.JAXBContext
Constructor Summary | |
---|---|
JAXBReader(String contextPath)
Creates a new JAXBReader for the given JAXB context path. | |
JAXBReader(String contextPath, ClassLoader classloader)
Creates a new JAXBReader for the given JAXB context path, using the
specified {@link java.lang.Classloader}. |
Method Summary | |
---|---|
void | addHandler(String path, ElementHandler handler)
Adds the ElementHandler to be called when the specified
path is encounted.
|
void | addObjectHandler(String path, JAXBObjectHandler handler)
Registers a {@link JAXBObjectHandler}that will be supplied with the
unmarshalled representation of the xml fragment whenever the specified
path is encounted.
|
boolean | isPruneElements()
When 'true', the DOM4J document will not be kept in memory while parsing.
|
Document | read(File source)
Parses the specified {@link java.io.File}
|
Document | read(File file, Charset charset)
Parses the specified {@link java.io.File}, using the given {@link
java.nio.charset.Charset}.
|
Document | read(InputSource source)
Parses the specified {@link org.xml.sax.InputSource}
|
Document | read(InputStream source)
Parses the specified {@link java.io.InputStream}
|
Document | read(InputStream source, String systemId)
Parses the specified {@link java.io.InputStream}
|
Document | read(Reader source)
Parses the specified {@link java.io.Reader}
|
Document | read(Reader source, String systemId)
Parses the specified {@link java.io.Reader}
|
Document | read(String source)
Parses the the given URL or filename.
|
Document | read(URL source)
Parses the the given URL.
|
void | removeHandler(String path)
Removes the ElementHandler from the event based processor,
for the specified path.
|
void | removeObjectHandler(String path)
Removes the {@link JAXBObjectHandler}from the event based processor, for
the specified element path.
|
void | resetHandlers()
Removes all registered {@link JAXBObjectHandler}and {@link
org.dom4j.ElementHandler} instances from the event based processor. |
void | setPruneElements(boolean pruneElements)
Set to true when DOM4J elements must immediately be pruned from the tree.
|
Parameters: contextPath context path to be used
See Also: javax.xml.bind.JAXBContext
Parameters: contextPath to be used classloader to be used
See Also: javax.xml.bind.JAXBContext
ElementHandler
to be called when the specified
path is encounted.
Parameters: path
is the path to be handled handler
is the ElementHandler
to be called by the event
based processor.
Parameters: path the path to listen for handler the handler to be notified
Returns: Returns the pruneElements.
Parameters: source the file to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: file the file to parse charset the charset to be used
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the source to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the input stream to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the input stream to parse systemId is the URI for the input
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the input reader to use
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the input reader to parse systemId is the URI for the input
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the location to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
Parameters: source the URL to parse
Returns: the resulting DOM4J document
Throws: DocumentException when an error occurs while parsing
ElementHandler
from the event based processor,
for the specified path.
Parameters: path
is the path to remove the ElementHandler
for.
Parameters: path The path to remove the {@link JAXBObjectHandler}for
Parameters: pruneElements