public class XMLSerializer extends Object
| Constructor and Description | 
|---|
XMLSerializer()
Default Constructor, setup basic XML output properties such as Encoding, Method, and Indent. 
 | 
XMLSerializer(File fileHandle)
Constructor with File Handle input. 
 | 
XMLSerializer(OutputStream outputStream)
Constructor with outputStream input. 
 | 
XMLSerializer(String filename)
Constructor with file path input paramter, uses the path to setup the output stream. 
 | 
XMLSerializer(Writer writer)
Constructor with Writer input. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
TransformerHandler | 
getTHandler()
Return a pointer to the TransformerHandler object created and managed by the serializer. 
 | 
void | 
setOutputProperty(String name,
                 String value)
Allow the user to specify arbitrary properties for output. 
 | 
void | 
setOutputStream(File fileHandle)
Set the OutputStream for this serializer from a File Handle. 
 | 
void | 
setOutputStream(OutputStream outputStream)
Set the OutputStream for this serializer. 
 | 
void | 
setOutputStream(String fileName)
Set the OutputStream for this serializer from a String file name. 
 | 
void | 
setWriter(Writer writer)
Set the Writer object for this serializer. 
 | 
public XMLSerializer()
              throws TransformerConfigurationException,
                     TransformerFactoryConfigurationError
TransformerConfigurationException - if there is an exception with the Transformer configuration.TransformerFactoryConfigurationError - if there is an exception with the Transformer Factory.public XMLSerializer(String filename) throws Exception
filename - Path to the file that will be written outException - if there are any Transformer or output stream exceptions.public XMLSerializer(File fileHandle) throws Exception
fileHandle - File Handle used for output stream.Exception - if there are any Transformer or output stream exceptions.public XMLSerializer(OutputStream outputStream) throws Exception
outputStream - OutputStream used to serialize the file.Exception - if there are any Transformer or output stream exceptions.public void setOutputStream(String fileName) throws FileNotFoundException
fileName - the file name, including path, to write out to.FileNotFoundException - if there is an error creating the file.public void setOutputStream(File fileHandle) throws FileNotFoundException
fileHandle - the file handle to write the output to.FileNotFoundException - if there is an error creating the file.public void setOutputStream(OutputStream outputStream)
outputStream - the output stream to write the xml to.public void setWriter(Writer writer)
writer - the writer to write the xml to.public void setOutputProperty(String name, String value)
name - Name of the propertyvalue - Value of the propertypublic TransformerHandler getTHandler()
Copyright © 2018 Department of Veterans Affairs. All Rights Reserved.