public class JsonArray extends JsonValue
A JSON array in a JsonTemplate; elements are added with object(), array() and value(String).
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds an anonymous array element and returns it; only arrays (and the template root) accept one.
    Returns the kind of JSON this node represents, which determines the child nodes it accepts.
    Adds an anonymous object element and returns it; only arrays (and the template root) accept one.
    value(String valueExpression)
    Adds a scalar element whose value is computed by the given expression; only valid on array nodes.
    protected void
    writeEndImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator)
    Writes this node's closing output, if any (such as an end-object or end-array token), after its children.
    protected void
    writeStartImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator)
    Writes this node's opening output, if any: a start-object or start-array token, a field name or a scalar value.

    Methods inherited from class com.northconcepts.datapipeline.json.builder.JsonValue

    detail, when

    Methods inherited from class com.northconcepts.datapipeline.json.builder.JsonNode

    add, array, assertType, exception, field, getNodes, hasNodes, isMarker, object, writeEnd, writeStart

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JsonArray

      public JsonArray()
  • Method Details

    • getType

      public JsonNodeType getType()
      Description copied from class: JsonNode
      Returns the kind of JSON this node represents, which determines the child nodes it accepts.
      Specified by:
      getType in class JsonNode
    • writeStartImpl

      protected void writeStartImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) throws Throwable
      Description copied from class: JsonNode
      Writes this node's opening output, if any: a start-object or start-array token, a field name or a scalar value.
      Specified by:
      writeStartImpl in class JsonNode
      Throws:
      Throwable
    • writeEndImpl

      protected void writeEndImpl(ExpressionContext context, com.fasterxml.jackson.core.JsonGenerator generator) throws Throwable
      Description copied from class: JsonNode
      Writes this node's closing output, if any (such as an end-object or end-array token), after its children.
      Specified by:
      writeEndImpl in class JsonNode
      Throws:
      Throwable
    • object

      public JsonObject object()
      Description copied from class: JsonNode
      Adds an anonymous object element and returns it; only arrays (and the template root) accept one.
      Overrides:
      object in class JsonNode
    • array

      public JsonArray array()
      Description copied from class: JsonNode
      Adds an anonymous array element and returns it; only arrays (and the template root) accept one.
      Overrides:
      array in class JsonNode
    • value

      public JsonArray value(String valueExpression)
      Description copied from class: JsonNode
      Adds a scalar element whose value is computed by the given expression; only valid on array nodes.
      Overrides:
      value in class JsonNode