T - Type to be written.public interface IVersatileWriter<T>
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
getAsByteBuffer()
Write the object to a
ByteBuffer and return it (write). |
byte[] |
getAsBytes()
Write the object to a byte array and return the created byte array (write).
|
Document |
getAsDocument()
Convert the object to a new DOM document (write).
|
com.helger.commons.io.stream.NonBlockingByteArrayInputStream |
getAsInputStream()
Write the object to a byte array and return the input stream on that array.
|
com.helger.xml.microdom.IMicroDocument |
getAsMicroDocument()
Convert the object to a new micro document (write).
|
com.helger.xml.microdom.IMicroElement |
getAsMicroElement()
Convert the object to a new micro document and return only the root element
(write).
|
String |
getAsString()
Utility method to directly convert the passed domain object to an XML
string (write).
|
com.helger.commons.state.ESuccess |
write(ByteBuffer aBuffer)
Write the object to a
ByteBuffer. |
com.helger.commons.state.ESuccess |
write(ContentHandler aHandler)
Convert the object to XML.
|
com.helger.commons.state.ESuccess |
write(File aResultFile)
Write the object to a
File. |
com.helger.commons.state.ESuccess |
write(com.helger.jaxb.IJAXBWriter.IJAXBMarshaller<T> aMarshallerFunc)
Convert the object to XML.
|
com.helger.commons.state.ESuccess |
write(com.helger.commons.io.resource.IWritableResource aResource)
Write the object to an
IWritableResource. |
com.helger.commons.state.ESuccess |
write(OutputStream aOS)
Write the object to an
OutputStream. |
com.helger.commons.state.ESuccess |
write(Path aResultPath)
Write the object to a
Path. |
com.helger.commons.state.ESuccess |
write(Result aResult)
Convert the object to XML.
|
com.helger.commons.state.ESuccess |
write(Writer aWriter)
Write the object to a
Writer. |
com.helger.commons.state.ESuccess |
write(XMLStreamWriter aWriter)
Convert the object to XML.
|
@Nonnull com.helger.commons.state.ESuccess write(@Nonnull File aResultFile)
File.aResultFile - The result file to be written to. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull Path aResultPath)
Path.aResultPath - The result path to be written to. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull @WillClose OutputStream aOS)
OutputStream.aOS - The output stream to write to. Will always be closed. May not be
null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull @WillClose Writer aWriter)
Writer.aWriter - The writer to write to. Will always be closed. May not be
null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull ByteBuffer aBuffer)
ByteBuffer.aBuffer - The byte buffer to write to. If the buffer is too small, it is
automatically extended. May not be null.ESuccessBufferOverflowException - If the ByteBuffer is too small@Nonnull com.helger.commons.state.ESuccess write(@Nonnull com.helger.commons.io.resource.IWritableResource aResource)
IWritableResource.aResource - The result resource to be written to. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull com.helger.jaxb.IJAXBWriter.IJAXBMarshaller<T> aMarshallerFunc)
aMarshallerFunc - The marshalling function. May not be null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull Result aResult)
SafeXMLStreamWriter it is ensured that only valid XML is created!aResult - The result object holder. May not be null. Usually
SAXResult, DOMResult and StreamResult are supported.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull ContentHandler aHandler)
aHandler - XML will be sent to this handler as SAX2 events. May not be
null.ESuccess@Nonnull com.helger.commons.state.ESuccess write(@Nonnull @WillClose XMLStreamWriter aWriter)
aWriter - XML will be sent to this writer. May not be null.ESuccess@Nullable Document getAsDocument()
null if converting the document failed.@Nullable com.helger.xml.microdom.IMicroDocument getAsMicroDocument()
null if converting the document failed.@Nullable com.helger.xml.microdom.IMicroElement getAsMicroElement()
null if converting the document failed.@Nullable String getAsString()
null if the passed domain object could not be
converted because of validation errors.@Nullable ByteBuffer getAsByteBuffer()
ByteBuffer and return it (write).null if the passed domain object could not be
converted because of validation errors.@Nullable byte[] getAsBytes()
null if the passed domain object could not be
converted because of validation errors.@Nullable com.helger.commons.io.stream.NonBlockingByteArrayInputStream getAsInputStream()
null if the passed domain object could not be
converted because of validation errors.Copyright © 2020 toop.eu. All rights reserved.