Package javax.json

Interface JsonArrayBuilder

    • Method Detail

      • add

        JsonArrayBuilder add​(JsonValue value)
        Adds a value to the array.
        Parameters:
        value - the JSON value
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified value is null
      • add

        JsonArrayBuilder add​(java.lang.String value)
        Adds a value to the array as a JsonString.
        Parameters:
        value - the string value
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified value is null
      • add

        JsonArrayBuilder add​(java.math.BigDecimal value)
        Adds a value to the array as a JsonNumber.
        Parameters:
        value - the number value
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified value is null
        See Also:
        JsonNumber
      • add

        JsonArrayBuilder add​(java.math.BigInteger value)
        Adds a value to the array as a JsonNumber.
        Parameters:
        value - the number value
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified value is null
        See Also:
        JsonNumber
      • add

        JsonArrayBuilder add​(double value)
        Adds a value to the array as a JsonNumber.
        Parameters:
        value - the number value
        Returns:
        this array builder
        Throws:
        java.lang.NumberFormatException - if the value is Not-a-Number(NaN) or infinity
        See Also:
        JsonNumber
      • add

        JsonArrayBuilder add​(JsonObjectBuilder builder)
        Adds a JsonObject from an object builder to the array.
        Parameters:
        builder - the object builder
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified builder is null
      • add

        JsonArrayBuilder add​(JsonArrayBuilder builder)
        Adds a JsonArray from an array builder to the array.
        Parameters:
        builder - the array builder
        Returns:
        this array builder
        Throws:
        java.lang.NullPointerException - if the specified builder is null
      • build

        JsonArray build​()
        Returns the current array.
        Returns:
        the current JSON array