Package org.imixs.workflow.xml
Class XMLDocumentAdapter
java.lang.Object
org.imixs.workflow.xml.XMLDocumentAdapter
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic XMLDocument
getDocument
(ItemCollection document) This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
static XMLDocument
getDocument
(ItemCollection document, String... itemNames) This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
static XMLDocument
getDocument
(ItemCollection document, List<String> itemNames) This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
static ItemCollection
putDocument
(XMLDocument xmlDocument) This Method converts aorg.imixs.workflow.xml.XMLItemCollection
into aorg.imixs.workflow.ItemCollection
Returns null if entity == nullstatic ItemCollection
readItemCollection
(byte[] byteInput) This method imports a single XMLItemCollection and returns the ItemCollection object.static ItemCollection
readItemCollectionFromInputStream
(InputStream inputStream) This method imports an xml entity data stream containing a singel document and returns the ItemCollection.static XMLDocument
readXMLDocument
(byte[] byteInput) This method reads a XMLItemCollection from a byte array.static XMLDocument
sortItemsByName
(XMLDocument xmlDocument) This method sorts all items of a XMLItemCollection by item name.static byte[]
writeItemCollection
(ItemCollection document) This method writes a ItemCollection into a Byte array representing a XMLDocument
-
Constructor Details
-
XMLDocumentAdapter
public XMLDocumentAdapter()
-
-
Method Details
-
putDocument
This Method converts aorg.imixs.workflow.xml.XMLItemCollection
into aorg.imixs.workflow.ItemCollection
Returns null if entity == null- Parameters:
entity
-- Returns:
- ItemCollection
-
getDocument
This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
- Parameters:
document
- instance of a ItemCollection to be converted
-
getDocument
This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
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 converteditemNames
- - optional list of item names to be converted. If null all items will be converted
-
getDocument
This Method converts aorg.imixs.workflow.ItemCollection
into aXMLDocument
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 converteditemNames
- - optional list of item names to be converted. If null all items will be converted
-
sortItemsByName
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
-