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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    array(String nameExpression)
    Adds an array-valued field and returns the new array; only valid on object nodes.
    field(String nameExpression, String valueExpression)
    Adds a scalar field whose name and value are computed by the given expressions; only valid on object nodes.
    Returns the kind of JSON this node represents, which determines the child nodes it accepts.
    object(String nameExpression)
    Adds an object-valued field and returns the new object; only valid on object 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, getNodes, hasNodes, isMarker, object, value, writeEnd, writeStart

    Methods inherited from class java.lang.Object

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

    • JsonObject

      public JsonObject()
  • 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(String nameExpression)
      Description copied from class: JsonNode
      Adds an object-valued field and returns the new object; only valid on object nodes.
      Overrides:
      object in class JsonNode
    • array

      public JsonArray array(String nameExpression)
      Description copied from class: JsonNode
      Adds an array-valued field and returns the new array; only valid on object nodes.
      Overrides:
      array in class JsonNode
    • field

      public JsonObject field(String nameExpression, String valueExpression)
      Description copied from class: JsonNode
      Adds a scalar field whose name and value are computed by the given expressions; only valid on object nodes.
      Overrides:
      field in class JsonNode