public class MarshalXML extends Object
| Modifier and Type | Field and Description |
|---|---|
protected JAXBContext |
jxbc |
protected Marshaller |
jxbm |
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
|
void |
marshal(Object jaxb)
Marshal an object to XML, writing out the result on standard out.
|
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 an object to XML, result is stored in filename
|
Document |
marshalToDOM(Object jaxb)
Marshal an object to a DOM document with a single element which is the
marshalled representation of the JAXB object
|
public 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 void 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 instanceCopyright © 2020 Tethys. All rights reserved.