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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic XMLDocumentgetDocument(ItemCollection document) This Method converts aorg.imixs.workflow.ItemCollectioninto aXMLDocumentstatic XMLDocumentgetDocument(ItemCollection document, String... itemNames) This Method converts aorg.imixs.workflow.ItemCollectioninto aXMLDocumentstatic XMLDocumentgetDocument(ItemCollection document, List<String> itemNames) This Method converts aorg.imixs.workflow.ItemCollectioninto aXMLDocumentstatic ItemCollectionputDocument(XMLDocument xmlDocument) This Method converts aorg.imixs.workflow.xml.XMLItemCollectioninto aorg.imixs.workflow.ItemCollectionReturns null if entity == nullstatic ItemCollectionreadItemCollection(byte[] byteInput) This method imports a single XMLItemCollection and returns the ItemCollection object.static ItemCollectionreadItemCollectionFromInputStream(InputStream inputStream) This method imports an xml entity data stream containing a singel document and returns the ItemCollection.static XMLDocumentreadXMLDocument(byte[] byteInput) This method reads a XMLItemCollection from a byte array.static XMLDocumentsortItemsByName(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.XMLItemCollectioninto aorg.imixs.workflow.ItemCollectionReturns null if entity == null- Parameters:
entity-- Returns:
- ItemCollection
-
getDocument
This Method converts aorg.imixs.workflow.ItemCollectioninto aXMLDocument- Parameters:
document- instance of a ItemCollection to be converted
-
getDocument
This Method converts aorg.imixs.workflow.ItemCollectioninto aXMLDocumentThe 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.ItemCollectioninto aXMLDocumentThe 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.JAXBExceptionIOException
-
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.JAXBExceptionIOException
-
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.JAXBExceptionIOException
-
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.JAXBExceptionIOException
-