Class Json.JsonBuilder<T>

java.lang.Object
io.quarkus.builder.Json.JsonBuilder<T>
Direct Known Subclasses:
Json.JsonArrayBuilder, Json.JsonObjectBuilder
Enclosing class:
Json

public abstract static class Json.JsonBuilder<T> extends Object
  • Field Details

    • ignoreEmptyBuilders

      protected final boolean ignoreEmptyBuilders
    • skipEscapeCharacters

      protected final boolean skipEscapeCharacters
      Skips escaping characters in string values. This option should be enabled when transforming JSON input, whose string values are already escaped. In situations like this, the option avoids escaping characters that are already escaped.
    • transform

      protected JsonTransform transform
  • Constructor Details

    • JsonBuilder

      JsonBuilder(boolean ignoreEmptyBuilders, boolean skipEscapeCharacters)
      Parameters:
      ignoreEmptyBuilders - If set to true all empty builders added to this builder will be ignored during build()
  • Method Details

    • isEmpty

      abstract boolean isEmpty()
      Returns:
      true if there are no elements/properties, false otherwise
    • build

      abstract String build() throws IOException
      Returns:
      a string representation
      Throws:
      IOException
    • appendTo

      abstract void appendTo(Appendable appendable) throws IOException
      Throws:
      IOException
    • isIgnored

      protected boolean isIgnored(Object value)
      Parameters:
      value -
      Returns:
      true if the value is null or an empty builder and ignoreEmptyBuilders is set to true, false otherwise
    • isValuesEmpty

      protected boolean isValuesEmpty(Collection<Object> values)
    • self

      protected abstract T self()
    • add

      abstract void add(JsonValue element)
    • setTransform

      void setTransform(JsonTransform transform)
    • transform

      public void transform(JsonMultiValue value, JsonTransform transform)