Package io.axoniq.dataprotection.serialization.xml

## Class Dom4JToByteArrayConverter

- java.lang.Object
- - io.axoniq.dataprotection.serialization.xml.Dom4JToByteArrayConverter

- All Implemented Interfaces:
    `ContentTypeConverter<org.dom4j.Document,​byte[]>`

      public class Dom4JToByteArrayConverter
      extends Object
      implements ContentTypeConverter<org.dom4j.Document,​byte[]>

  Converter that converts Dom4j Document instances to a byte array. The Document is written as XML string, and converted to bytes using the UTF-8 character set.
  Since:
    2.0
  Author:
    Allard Buijze

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Dom4JToByteArrayConverter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `byte[]` | `convert​(org.dom4j.Document original)` | Converts the given object into another.
    `Class<org.dom4j.Document>` | `expectedSourceType()` | The expected type of input data.
    `Class<byte[]>` | `targetType()` | The returned type of IntermediateRepresentation

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Dom4JToByteArrayConverter

          public Dom4JToByteArrayConverter()

  - ### Method Detail

    - #### expectedSourceType

          public Class<org.dom4j.Document> expectedSourceType()

      Description copied from interface: `ContentTypeConverter`
      The expected type of input data.
      Specified by:
        `expectedSourceType` in interface `ContentTypeConverter<org.dom4j.Document,​byte[]>`
      Returns:
        the expected data format in IntermediateRepresentation

    - #### targetType

          public Class<byte[]> targetType()

      Description copied from interface: `ContentTypeConverter`
      The returned type of IntermediateRepresentation
      Specified by:
        `targetType` in interface `ContentTypeConverter<org.dom4j.Document,​byte[]>`
      Returns:
        the output data format in IntermediateRepresentation

    - #### convert

          public byte[] convert​(org.dom4j.Document original)

      Description copied from interface: `ContentTypeConverter`
      Converts the given object into another. Typically, these values are contained by a `SerializedObject` instance.
      Specified by:
        `convert` in interface `ContentTypeConverter<org.dom4j.Document,​byte[]>`
      Parameters:
        `original` - the value to convert
      Returns:
        the converted value