|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dom4j.jaxb.JAXBSupport
org.dom4j.jaxb.JAXBWriter
Writes Elementobjects to an XML stream. Element instances can be created using the ObjectFactory that
is generated by the JAXB compiler.
XMLWriter,
JAXBContext| Constructor Summary | |
JAXBWriter(String contextPath)
Creates a new JAXBWriter for the given JAXB context path. |
|
JAXBWriter(String contextPath,
ClassLoader classloader)
Creates a new JAXBWriter for the given JAXB context path, using the specified Classloader. |
|
JAXBWriter(String contextPath,
ClassLoader classloader,
OutputFormat outputFormat)
Creates a new JAXBWriter for the given JAXB context path, using the specified Classloader. |
|
JAXBWriter(String contextPath,
OutputFormat outputFormat)
Creates a new JAXBWriter for the given JAXB context path. |
|
| Method Summary | |
void |
endDocument()
Stop writing the document to the output. |
OutputFormat |
getOutputFormat()
Returns the OutputFormat that will be used when writing the XML stream. |
protected Element |
marshal(javax.xml.bind.Element element)
Marshals the given Elementin to its DOM4J
counterpart. |
void |
setOutput(File file)
Defines to write the resulting output to the specified File. |
void |
setOutput(OutputStream outputStream)
Defines to write the resulting output to the specified OutputStream |
void |
setOutput(Writer writer)
Defines to write the resulting output to the specified Writer. |
void |
startDocument()
Start a document by writing the initial XML declaration to the output. |
protected javax.xml.bind.Element |
unmarshal(Element element)
Unmarshalls the specified DOM4J Elementinto a Element |
void |
write(javax.xml.bind.Element jaxbObject)
Writes the specified Elementto the document.
|
void |
writeClose(javax.xml.bind.Element jaxbObject)
Writes the closing tag of the specified Elementto
the document. |
void |
writeCloseElement(Element element)
Writes the closing tag of the specified Elementto the
document. |
void |
writeElement(Element element)
Writes the specified Elementto the document. |
void |
writeOpen(javax.xml.bind.Element jaxbObject)
Writes the opening tag of the specified Elementto
the document. |
void |
writeOpenElement(Element element)
Writes the opening tag of the specified Elementto the
document. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JAXBWriter(String contextPath)
contextPath - JAXB context path to be usedJAXBContext
public JAXBWriter(String contextPath,
OutputFormat outputFormat)
OutputFormatwill be used for writing the XML
stream.
contextPath - JAXB context path to be usedoutputFormat - the DOM4J OutputFormatto be usedJAXBContext
public JAXBWriter(String contextPath,
ClassLoader classloader)
Classloader. (This is the Java package where
JAXB can find the generated XML classes. This package MUST contain
jaxb.properties!)
contextPath - JAXB context path to be usedclassloader - the classloader to be used for loading JAXBJAXBContext
public JAXBWriter(String contextPath,
ClassLoader classloader,
OutputFormat outputFormat)
Classloader. The specied OutputFormat will be used while writing the XML stream.
contextPath - JAXB context path to be usedclassloader - the class loader to be used to load JAXBoutputFormat - the DOM4J OutputFormatto be usedJAXBContext| Method Detail |
public OutputFormat getOutputFormat()
public void setOutput(File file)
throws IOException
File.
file - file to write to
IOException - when the file cannot be found
public void setOutput(OutputStream outputStream)
throws IOException
OutputStream
outputStream - outputStream to write to.
IOException - DOCUMENT ME!
public void setOutput(Writer writer)
throws IOException
Writer.
writer - writer to write to
IOException
public void startDocument()
throws IOException,
SAXException
IOException - if an error occured while writing the output
SAXException - thrown by the underlying SAX driver
public void endDocument()
throws IOException,
SAXException
IOException - if an error occured while writing the output
SAXException - thrown by the underlying SAX driver
public void write(javax.xml.bind.Element jaxbObject)
throws IOException,
javax.xml.bind.JAXBException
Elementto the document.
Elementinstances can be created using the
ObjectFactory that is generated by the JAXB compiler.
jaxbObject -
IOException - if an error occured while writing the output
javax.xml.bind.JAXBException - when an error occured while marshalling the jaxbObject
public void writeClose(javax.xml.bind.Element jaxbObject)
throws IOException,
javax.xml.bind.JAXBException
Elementto
the document. This method can be used for writing Element instances can be created using the ObjectFactory
that is generated by the JAXB compiler.
jaxbObject - the JAXB element to write
IOException - if an error occured while writing the output
javax.xml.bind.JAXBException - when an error occured while marshalling the jaxbObject
public void writeOpen(javax.xml.bind.Element jaxbObject)
throws IOException,
javax.xml.bind.JAXBException
Elementto
the document. Elementinstances can be created
using the ObjectFactory that is generated by the JAXB compiler.
jaxbObject - the JAXB element to write
IOException - if an error occured while writing the output
javax.xml.bind.JAXBException - when an error occured while marshalling the jaxbObject
public void writeElement(Element element)
throws IOException
Elementto the document.
element - the Elementto write
IOException - if an error occured while writing the output
public void writeCloseElement(Element element)
throws IOException
Elementto the
document.
element - the Elementto write
IOException - if an error occured while writing the output
public void writeOpenElement(Element element)
throws IOException
Elementto the
document.
element - the Elementto write
IOException - if an error occured while writing the output
protected Element marshal(javax.xml.bind.Element element)
throws javax.xml.bind.JAXBException
Elementin to its DOM4J
counterpart.
element - JAXB Element to be marshalled
Element
javax.xml.bind.JAXBException - when an error occurs
protected javax.xml.bind.Element unmarshal(Element element)
throws javax.xml.bind.JAXBException
Elementinto a Element
element - the DOM4J element to unmarshall
javax.xml.bind.JAXBException - when an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||