be.ehealth.technicalconnector.utils

## Class MarshallerHelper<X,Y>

- java.lang.Object
- - be.ehealth.technicalconnector.utils.MarshallerHelper<X,Y>

- Type Parameters:
    `X` - the generic type
    `Y` - the generic type

      public class MarshallerHelper<X,Y>
      extends Object

  The Class MarshallerHelper.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_XOP_THRESHOLD`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarshallerHelper(Class<X> unmarshallClass, Class<Y> marshallClass)` Instantiates a new marshaller helper.
    `MarshallerHelper(Class<X> unmarshallClass, Class<Y> marshallClass, boolean format)` Instantiates a new marshaller helper.
    `MarshallerHelper(Class<X> unmarshallClass, Class<Y> marshallClass, boolean format, boolean xop)` Instantiates a new marshaller helper.
    `MarshallerHelper(Class<X> unmarshallClass, Class<Y> marshallClass, boolean format, boolean xop, int threshold)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttachmentPart(String id, AttachmentPart attachmentPart)`
    `void` | `clearAttachmentPartMap()`
    `Map<String,DataHandler>` | `getDataHandlersMap()` Obtain the marshalled attachement as datahandler
    `Document` | `toDocument(Y data)`
    `X` | `toObject(byte[] data)` To object.
    `X` | `toObject(InputStream inputStream)` To object.
    `X` | `toObject(Node source)` To object.
    `X` | `toObject(String data)` To object.
    `String` | `toString(Y data)` returns marshalled data element.
    `byte[]` | `toXMLByteArray(Y data)` To xml byte array.

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

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

- - ### Field Detail

    - #### DEFAULT_XOP_THRESHOLD

          public static final int DEFAULT_XOP_THRESHOLD

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MarshallerHelper

          public MarshallerHelper(Class<X> unmarshallClass,
                                  Class<Y> marshallClass)

      Instantiates a new marshaller helper.
      Parameters:
        `unmarshallClass` - the unmarshall class
        `marshallClass` - the marshall class

    - #### MarshallerHelper

          public MarshallerHelper(Class<X> unmarshallClass,
                                  Class<Y> marshallClass,
                                  boolean format)

      Instantiates a new marshaller helper.
      Parameters:
        `unmarshallClass` - the unmarshall class
        `marshallClass` - the marshall class
        `format` - property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.

    - #### MarshallerHelper

          public MarshallerHelper(Class<X> unmarshallClass,
                                  Class<Y> marshallClass,
                                  boolean format,
                                  boolean xop)

      Instantiates a new marshaller helper.
      Parameters:
        `unmarshallClass` - the unmarshall class
        `marshallClass` - the marshall class
        `format` - property used to specify whether or not the marshalled XML data is formatted with linefeeds and indentation.
        `xop` -

    - #### MarshallerHelper

          public MarshallerHelper(Class<X> unmarshallClass,
                                  Class<Y> marshallClass,
                                  boolean format,
                                  boolean xop,
                                  int threshold)

  - ### Method Detail

    - #### addAttachmentPart

          public void addAttachmentPart(String id,
                                        AttachmentPart attachmentPart)

    - #### clearAttachmentPartMap

          public void clearAttachmentPartMap()

    - #### getDataHandlersMap

          public Map<String,DataHandler> getDataHandlersMap()

      Obtain the marshalled attachement as datahandler

    - #### toDocument

          public Document toDocument(Y data)

    - #### toObject

          public X toObject(byte[] data)

      To object.
      Parameters:
        `data` - the data
      Returns:
        the x

    - #### toObject

          public X toObject(InputStream inputStream)

      To object.
      Parameters:
        `inputStream` - the input stream
      Returns:
        the x
      Throws:
        `TechnicalConnectorException`

    - #### toObject

          public X toObject(Node source)

      To object.
      Parameters:
        `source` -
      Returns:

    - #### toObject

          public X toObject(String data)

      To object.
      Parameters:
        `data` - the data
      Returns:
        the x

    - #### toString

          public String toString(Y data)

      returns marshalled data element.
      Parameters:
        `data` - jaxbElement
      Returns:
        String

    - #### toXMLByteArray

          public byte[] toXMLByteArray(Y data)

      To xml byte array.
      Parameters:
        `data` - the data
      Returns:
        the byte[]

Connector Packaging TRUSSMAKER 4.4.0 API
Copyright © {inceptionYear}-2023 eHealth. All Rights Reserved.