|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.asdf.utils.XMLTools
public class XMLTools
Tools for (un)marshalling XML data from objects to byte arrays and from byte array to objects.
| Constructor Summary | |
|---|---|
XMLTools()
Constructs XMLTools object. |
|
XMLTools(java.lang.String jaxbContext,
java.lang.String schemaLocation)
Constructs XMLTools object. |
|
| Method Summary | |
|---|---|
Message |
bytesToMessage(byte[] rawData)
Converts byte array to Message instance |
Message |
loadMessageFromFile(java.lang.String path)
Unmarshalls object from file and casts it to Message. |
java.lang.Object |
loadObjectFromFile(java.lang.String path)
Unmarshalls object from file. |
byte[] |
marshallObject(java.lang.Object obj)
Converts object into byte array |
org.w3c.dom.Element |
marshallObjectToElement(java.lang.Object obj)
|
byte[] |
messageToBytes(Message msg)
Converts Message to byte array. |
java.lang.Object |
unmarshallBytes(byte[] bytes)
Converts byte array into Message object |
java.lang.Object |
unmarshallNode(org.w3c.dom.Node e)
Convert given Node to object |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLTools()
public XMLTools(java.lang.String jaxbContext,
java.lang.String schemaLocation)
throws org.xml.sax.SAXException,
javax.xml.bind.JAXBException
jaxbContext - Name of the JAXB contextschemaLocation - Path to the XML schema file
org.xml.sax.SAXException - If schema is invalid
javax.xml.bind.JAXBException - If context can't be initialized| Method Detail |
|---|
public java.lang.Object unmarshallBytes(byte[] bytes)
throws javax.xml.bind.JAXBException
bytes - Byte array
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid data
public java.lang.Object unmarshallNode(org.w3c.dom.Node e)
throws javax.xml.bind.JAXBException
e - Node to convert
javax.xml.bind.JAXBException
public byte[] marshallObject(java.lang.Object obj)
throws javax.xml.bind.JAXBException
obj - Object to convert
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid message
public org.w3c.dom.Element marshallObjectToElement(java.lang.Object obj)
throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public Message loadMessageFromFile(java.lang.String path)
throws javax.xml.bind.JAXBException
path - Path to the file
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid message
public java.lang.Object loadObjectFromFile(java.lang.String path)
throws javax.xml.bind.JAXBException
path - Path to the file
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid data
public Message bytesToMessage(byte[] rawData)
throws javax.xml.bind.JAXBException
rawData - Raw data to convert
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid message
public byte[] messageToBytes(Message msg)
throws javax.xml.bind.JAXBException
msg - Message to convert
javax.xml.bind.JAXBException - In case of not conforming to schema or otherwise
invalid message
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||