public class XMLFileIO<T> extends Object
Constructor and Description |
---|
XMLFileIO()
Constructor
|
Modifier and Type | Method and Description |
---|---|
T |
readXml(File file,
Class<T> clazz)
Reads and xml file using JAXB.
|
void |
writeXml(File file,
T obj)
Writes a JAXB instance object to a file.
|
public T readXml(File file, Class<T> clazz) throws IOException
file
- the file to read.clazz
- the JAXBContext classIOException
- if any failure loading or passing the file.public void writeXml(File file, T obj) throws IOException
file
- the file to write to.obj
- the object instance of type <T>IOException
- if any failure writing the file.