Class ImixsJSONParser
The method 'parse()' returns in any case a collection of ItemCollection.
- Author:
- rsoika
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final List<ItemCollection>
parse
(InputStream jsonDataStream) This method parses an Imixs JSON input stream and returns a List of Imixs ItemCollection instances.
-
Field Details
-
DATA_ELEMENT
- See Also:
-
ITEM_ELEMENT
- See Also:
-
NAME_ELEMENT
- See Also:
-
VALUE_ELEMENT
- See Also:
-
-
Constructor Details
-
ImixsJSONParser
public ImixsJSONParser()
-
-
Method Details
-
parse
public static final List<ItemCollection> parse(InputStream jsonDataStream) throws ParseException, UnsupportedEncodingException This method parses an Imixs JSON input stream and returns a List of Imixs ItemCollection instances.The method supports both - a single document (item element) or a collection of documents (data element). In both cases the method returns a collection of ItemCollections Example-1:
{ "item":[ {"name":"$isauthor","value":{"@type":"xs:boolean","$":"true"}}, {"name":"$readaccess","value":{"@type":"xs:string","$":"Anna"}}, {"name":"txtmessage","value":{"@type":"xs:string","$":"worklist"}}, {"name":"txtlog","value":[ {"@type":"xs:string","$":"A"}, {"@type":"xs:string","$":"B"}, {"@type":"xs:string","$":"C"}] }, {"name":"$activityid","value":{"@type":"xs:int","$":"0"}} ] }
Example-2:{ "data": [ { "item":[ {"name":"$isauthor","value":{"@type":"xs:boolean","$":"true"}}, {"name":"$readaccess","value":{"@type":"xs:string","$":"Anna"}} ] }, { "item":[ {"name":"$isauthor","value":{"@type":"xs:boolean","$":"true"}}, {"name":"$readaccess","value":{"@type":"xs:string","$":"Anna"}} ] } ] }
- Parameters:
requestBodyStream
-encoding
- - default encoding use to parse the stream- Returns:
- a workitem
- Throws:
ParseException
UnsupportedEncodingException
-