Class JsonBuilderJNI


  • public final class JsonBuilderJNI
    extends Object
    The type Json builder jni.
    • Constructor Detail

      • JsonBuilderJNI

        public JsonBuilderJNI()
    • Method Detail

      • createBuilder

        public static JsonBuilder createBuilder()
        Create builder json value.
        Returns:
        the JsonBuilder object
      • addItem

        public static int addItem​(SafeHandle builderHandle,
                                  int item,
                                  int index,
                                  String find)
        Adds an item to the specified ajv item
        Parameters:
        builderHandle - the parser handle
        item - the specified ajv item to add to
        index - the index to add the new item at
        find - the json key to associate with the new item
        Returns:
        the ajv item added
      • setItem

        public static int setItem​(SafeHandle builderHandle,
                                  int item,
                                  String json,
                                  com.microsoft.cognitiveservices.speech.util.JsonValueJNI.ValueKind kind,
                                  String str,
                                  boolean boolValue,
                                  int integer,
                                  double number)
        Adds an item to the specified ajv item
        Parameters:
        builderHandle - the parser handle
        item - the specified ajv item to add to
        json - the json string to be used if kind = JSON
        kind - the kind of value being added
        str - the string value to be used if kind = STRING
        boolValue - the boolean value to be used if kind = BOOLEAN
        integer - the integer value to be used if kind = NUMBER
        number - the doubl value to be used if kind = NUMBER
        Returns:
        An HR result indicating error or success
      • asJsonCopy

        public static String asJsonCopy​(SafeHandle builder,
                                        int item)
        As json string.
        Parameters:
        builder - the builder
        item - the item
        Returns:
        the string