Class XMLDocumentAdapter

java.lang.Object
org.imixs.workflow.xml.XMLDocumentAdapter

public class XMLDocumentAdapter extends Object
An XMLDocumentAdapter converts a org.imixs.workflow.xml.XMLDocument into a org.imixs.workflow.ItemCollection and reverse
Version:
1.1
Author:
imixs.com - Ralph Soika
See Also:
  • Constructor Details

    • XMLDocumentAdapter

      public XMLDocumentAdapter()
  • Method Details

    • putDocument

      public static ItemCollection putDocument(XMLDocument xmlDocument)
      This Method converts a org.imixs.workflow.xml.XMLItemCollection into a org.imixs.workflow.ItemCollection Returns null if entity == null
      Parameters:
      entity -
      Returns:
      ItemCollection
    • getDocument

      public static XMLDocument getDocument(ItemCollection document)
      This Method converts a org.imixs.workflow.ItemCollection into a XMLDocument
      Parameters:
      document - instance of a ItemCollection to be converted
    • getDocument

      public static XMLDocument getDocument(ItemCollection document, List<String> itemNames)
      This Method converts a org.imixs.workflow.ItemCollection into a XMLDocument

      The method verifies if the values stored are basic java types. If not these values will not be converted!

      Parameters:
      document - instance of a ItemCollection to be converted
      itemNames - - optional list of item names to be converted. If null all items will be converted
    • getDocument

      public static XMLDocument getDocument(ItemCollection document, String... itemNames)
      This Method converts a org.imixs.workflow.ItemCollection into a XMLDocument

      The method verifies if the values stored are basic java types. If not these values will not be converted!

      Parameters:
      document - instance of a ItemCollection to be converted
      itemNames - - optional list of item names to be converted. If null all items will be converted
    • sortItemsByName

      public static XMLDocument sortItemsByName(XMLDocument xmlDocument)
      This method sorts all items of a XMLItemCollection by item name.
      Parameters:
      xmlDocument -
      Returns:
    • readItemCollectionFromInputStream

      public static ItemCollection readItemCollectionFromInputStream(InputStream inputStream) throws jakarta.xml.bind.JAXBException, IOException
      This method imports an xml entity data stream containing a singel document and returns the ItemCollection.
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • readItemCollection

      public static ItemCollection readItemCollection(byte[] byteInput) throws jakarta.xml.bind.JAXBException, IOException
      This method imports a single XMLItemCollection and returns the ItemCollection object.
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • readXMLDocument

      public static XMLDocument readXMLDocument(byte[] byteInput) throws jakarta.xml.bind.JAXBException, IOException
      This method reads a XMLItemCollection from a byte array.
      Parameters:
      byteInput - - xml data
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException
    • writeItemCollection

      public static byte[] writeItemCollection(ItemCollection document) throws jakarta.xml.bind.JAXBException, IOException
      This method writes a ItemCollection into a Byte array representing a XMLDocument
      Parameters:
      inputStream - xml input stream
      Returns:
      List of ItemCollection objects
      Throws:
      jakarta.xml.bind.JAXBException
      IOException