public class MarshalXML extends Object
| Modifier and Type | Field and Description |
|---|---|
protected JAXBContext |
jxbc |
protected Marshaller |
jxbm |
static String |
schema |
static String |
schemaLoc |
| Constructor and Description |
|---|
MarshalXML()
Nilus Marshaller class for Tethys w default schema location
|
MarshalXML(String loc)
Nilus Marshaler class for Tehtys with specific schema location
|
| Modifier and Type | Method and Description |
|---|---|
JAXBContext |
createInstance(Class c)
createInstance
Create an instance of a Tethys schema class.
|
private void |
initMarshalXML(String loc)
Initialize the XML
|
String |
marshal(Object jaxb)
Marshal an object to XML contained in a String.
|
void |
marshal(Object jaxb,
OutputStream out)
Marshal an object to XML, writing out the result to an OutputStream
or one of its derived classes
|
void |
marshal(Object jaxb,
PrintWriter out)
Marshal an object to XML, writing out the result to a PrintWriter
output stream.
|
void |
marshal(Object jaxb,
String filename)
Marshal object to XML that will be stored in file
|
Document |
marshalToDOM(Object jaxb)
Marshal an object to a DOM document with a single element which is the
marshalled representation of the JAXB object
|
Deployment |
unmarshallDeployment(String xml)
Given a string with a valid Deployment document, unmarshal to
plain-old Java objects (POJOs) generated by the JAXB compiler.
|
public static String schema
public static String schemaLoc
protected JAXBContext jxbc
protected Marshaller jxbm
public MarshalXML()
throws JAXBException
JAXBException - Unable to marshalpublic MarshalXML(String loc) throws JAXBException
loc - - Use null or "" for no locationJAXBException - Unable to marshalprivate void initMarshalXML(String loc) throws JAXBException
loc - Schema specification/locationJAXBExceptionpublic void marshal(Object jaxb, String filename) throws FileNotFoundException, JAXBException
jaxb - - Object to be marshaledfilename - - name of file to be writtenFileNotFoundException - Unable to open file for outputJAXBException - Erorr marshaling to XMLpublic String marshal(Object jaxb) throws JAXBException
jaxb - - Object to be marshaledJAXBException - Error marshaling to XMLpublic void marshal(Object jaxb, PrintWriter out) throws JAXBException
jaxb - - Object to be marshalledout - - Writer stream to which object should be marshalledJAXBException - Erorr marshaling to XMLpublic void marshal(Object jaxb, OutputStream out) throws JAXBException
jaxb - - Object to be marshalledout - - java.io.OutpuStrream to which object should be marshalledJAXBException - Error marshaling to XMLpublic Document marshalToDOM(Object jaxb) throws JAXBException, ParserConfigurationException
jaxb - JAX object to be marshaled to DOMJAXBException - Unable to marshalParserConfigurationException - Internal problempublic JAXBContext createInstance(Class c) throws JAXBException
c - Create an instance of the specified schema class (Tethys
schema objectJAXBException - Unable to create the instancepublic Deployment unmarshallDeployment(String xml) throws JAXBException
xml - - UTF-8 stringJAXBExceptionCopyright © 2024 Tethys. All rights reserved.