Class ImixsJSONBuilder

java.lang.Object
org.imixs.workflow.util.ImixsJSONBuilder

public class ImixsJSONBuilder extends Object
The ImixsJSONBuilder is an utility class to generate a typed json string from an Imixs ItemCollection.

The result can be converted back into a ItemCollection by using the ImixsJSONParser class.

Author:
rsoika
  • Field Details

  • Constructor Details

    • ImixsJSONBuilder

      public ImixsJSONBuilder()
  • Method Details

    • build

      public static final String build(ItemCollection workitem) throws ParseException, UnsupportedEncodingException
      This method builds a typed JSON output stream from a Imixs ItemCollection. Example Output: { "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":"$eventid","value":{"@type":"xs:int","$":"0"}} ] }
      Parameters:
      worktiem - - ItemCollection to be translated into JSON
      Returns:
      a JSON string
      Throws:
      ParseException
      UnsupportedEncodingException