Package org.imixs.workflow.util
Klasse JSONParser
java.lang.Object
org.imixs.workflow.util.JSONParser
The JSONParser is an utility class to parse JSON structures. The parser
provides methods to transfer a Imixs JSON structure into a Imixs
ItemCollection as well as helper methods to extract single values from a JSON
structure.
The method parseWorkitem translates a JSON structure containing a Imixs Document into a ItemCollection.
- Autor:
- rsoika
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic StringThis method extracts a single key from a JSON structure.static final ItemCollectionparseWorkitem(InputStream requestBodyStream, String _encoding) Veraltet.
-
Konstruktordetails
-
JSONParser
public JSONParser()
-
-
Methodendetails
-
getKey
This method extracts a single key from a JSON structure. It does not matter where the key is defined within the JSON structure. The method simply returns the first match.It is also possible to get a JSON object or an JSON array embedded in the given JSON structure. This object can be parsed again with this method.
- Parameter:
key-json-- Gibt zurück:
- - the json value or the json object for the corresponding json key
-
parseWorkitem
@Deprecated public static final ItemCollection parseWorkitem(InputStream requestBodyStream, String _encoding) throws ParseException, UnsupportedEncodingException Veraltet.This method parses an Imixs JSON input stream and returns a Imixs ItemCollection. Example:{ "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"}} ] }- Parameter:
requestBodyStream-encoding- - default encoding use to parse the stream- Gibt zurück:
- a workitem
- Löst aus:
ParseExceptionUnsupportedEncodingException
-