Package 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
  Description
  `static final int`
  `DEFAULT_XOP_THRESHOLD`

- ## Constructor Summary

  Constructors
  Constructor
  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

  Modifier and Type
  Method
  Description
  `void`
  `addAttachmentPart(String id, jakarta.xml.soap.AttachmentPart attachmentPart)`
  `void`
  `clearAttachmentPartMap()`
  `Map<String,jakarta.activation.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(String data)`
  To object.
  `X`
  `toObject(Node source)`
  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 Details

  - ### DEFAULT_XOP_THRESHOLD

    public static final int DEFAULT_XOP_THRESHOLD
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### 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 Details

  - ### addAttachmentPart

    public void addAttachmentPart(String id, jakarta.xml.soap.AttachmentPart attachmentPart)

  - ### clearAttachmentPartMap

    public void clearAttachmentPartMap()

  - ### getDataHandlersMap

    public Map<String,jakarta.activation.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[]