Class XMLWriter<T>
java.lang.Object
com.foursoft.harness.navext.runtime.io.write.XMLWriter<T>
Serializes a valid JAXB object structure to XML with the following additional features:
- Can add comments to the xml file
- Formats the XML output
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureMarshaller(jakarta.xml.bind.Marshaller marshaller) Method which can be overridden for further configuration on the marshaller.voidwrite(T container, XMLMeta meta, OutputStream outputStream) write the JAXB model to an output streamvoidwrite(T container, OutputStream outputStream) write the JAXB model to an output streamwriteToString(T container) write the JAXB model to a stringwriteToString(T container, XMLMeta meta) Write the JAXB model to a String.
-
Constructor Details
-
XMLWriter
-
XMLWriter
-
-
Method Details
-
write
write the JAXB model to an output stream- Parameters:
container- the jaxb model to deserialize into the given streamoutputStream- the output to write to
-
writeToString
write the JAXB model to a string- Parameters:
container- the jaxb model to deserialize into the given stream- Returns:
- the model as xml string
-
configureMarshaller
Method which can be overridden for further configuration on the marshaller.- Parameters:
marshaller- Marshaller to configure.- Throws:
Exception- In case something went wrong.
-