|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.daileon.xml.JaxbXmlHandler
public class JaxbXmlHandler
Represents the JAXB implementation of the XmlHandler
interface.
The JaxbXmlHandler
is responsible for reading the XML
configuration file and retrieving an Object
representation of
it, as well as serializing the content of a given Object
(which
must be properly annotated with annotations of the JAXB 2.0 API) to a
particular OutputStream
.
Field Summary | |
---|---|
private static String |
XSD_PATH
The path to the XSD schema of the XML configuration file |
Constructor Summary | |
---|---|
JaxbXmlHandler()
Class constructor. |
Method Summary | |
---|---|
void |
beanToXml(Object bean,
OutputStream destiny,
String jaxbContext)
Serializes the content of a given object to an OutputStream . |
Object |
xmlToBean(InputStream source,
String jaxbContext)
Retrieves the content of a given XML file as an Object . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String XSD_PATH
Constructor Detail |
---|
JaxbXmlHandler()
Method Detail |
---|
public void beanToXml(Object bean, OutputStream destiny, String jaxbContext) throws XmlHandlerException
OutputStream
.
beanToXml
in interface XmlHandler
bean
- The object to be serialized in form of XML file.destiny
- The destination (as OutputStream
) of the XML file
to be serialized.jaxbContext
- The context of the XML file. For instance, for the
JaxbXmlHandler
implementation, the context is the
package where the objects that represent the XML structure are
located.
XmlHandlerException
- If any problem occur when trying to serialize the object.public Object xmlToBean(InputStream source, String jaxbContext) throws XmlHandlerException
Object
.
xmlToBean
in interface XmlHandler
source
- The XML file to be read, as InputStream
.jaxbContext
- The context of the XML file. For instance, for the
JaxbXmlHandler
implementation, the context is the
package where the objects that represent the XML structure are
located.
Object
.
XmlHandlerException
- If any problem occur when trying to read the XML file and
transform it to an Object
representation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |