public final class XmlSerializationUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Record |
deserialize(byte[] byteArray)
De-serialize a serialized record (byte[]) to a record.
|
static Record |
deserialize(org.w3c.dom.Document document)
Deserialize a record from a Document.
|
static Record |
deserialize(java.lang.String xmlString)
Deserialize a record from an xmlString.
|
static Record |
deserializeNoAttachments(java.io.InputStream recordInputStream) |
static DOMRecordReader |
getRecordParser()
Get the RecordParser.
|
static StaxRecordReader |
getRecordReader()
Get the RecordReader.
|
static StaxRecordWriter |
getRecordWriter()
Get the RecordWriter.
|
static javax.xml.stream.XMLInputFactory |
getStaxReaderFactory()
Get the XMLInputFactory.
|
static javax.xml.stream.XMLOutputFactory |
getStaxWriterFactory()
Get the XMLOutputFactory.
|
static byte[] |
serialize2byteArray(Record record)
Serializes a Record into a byte[].
|
static java.io.ByteArrayOutputStream |
serialize2stream(Record record)
Serializes a Record in UTF-8 into a ByteArrayOutputStream.
|
static void |
serialize2stream(Record record,
java.io.OutputStream out)
Serializes a Record into the given stream in UTF-8.
|
static java.lang.String |
serialize2string(Record record)
Serializes a Record into a String.
|
public static java.lang.String serialize2string(Record record)
record
- the recordpublic static byte[] serialize2byteArray(Record record)
record
- the recordpublic static java.io.ByteArrayOutputStream serialize2stream(Record record)
record
- the recordpublic static void serialize2stream(Record record, java.io.OutputStream out)
record
- the recordout
- needs to be closed by the callerpublic static Record deserialize(byte[] byteArray) throws DeserializationException
byteArray
- the byte arrayDeserializationException
- the datamodel deserialization exceptionpublic static Record deserializeNoAttachments(java.io.InputStream recordInputStream) throws javax.xml.stream.XMLStreamException
recordInputStream
- javax.xml.stream.XMLStreamException
public static Record deserialize(java.lang.String xmlString) throws DeserializationException
xmlString
- the xml stringDeserializationException
- the datamodel deserialization exceptionpublic static Record deserialize(org.w3c.dom.Document document) throws DeserializationException
document
- the documentDeserializationException
- the datamodel deserialization exceptionpublic static DOMRecordReader getRecordParser()
public static javax.xml.stream.XMLOutputFactory getStaxWriterFactory()
public static javax.xml.stream.XMLInputFactory getStaxReaderFactory()
public static StaxRecordWriter getRecordWriter()
public static StaxRecordReader getRecordReader()