类 BasicJsonWriter

java.lang.Object
cn.taketoday.aot.nativex.BasicJsonWriter

class BasicJsonWriter extends Object
Very basic json writer for the purposes of translating runtime hints to native configuration.
作者:
Stephane Nicoll
  • 字段详细资料

  • 构造器详细资料

    • BasicJsonWriter

      public BasicJsonWriter(Writer writer, String singleIndent)
      Create a new instance with the specified indent value.
      参数:
      writer - the writer to use
      singleIndent - the value of one indent
    • BasicJsonWriter

      public BasicJsonWriter(Writer writer)
      Create a new instance using two whitespaces for the indent.
      参数:
      writer - the writer to use
  • 方法详细资料

    • writeObject

      public void writeObject(Map<String,Object> attributes)
      Write an object with the specified attributes. Each attribute is written according to its value type:
      • Map: write the value as a nested object
      • List: write the value as a nested array
      • Otherwise, write a single value
      参数:
      attributes - the attributes of the object
    • writeArray

      public void writeArray(List<?> items)
      Write an array with the specified items. Each item in the list is written either as a nested object or as an attribute depending on its type.
      参数:
      items - the items to write
      另请参阅:
    • writeObject

      private void writeObject(Map<String,Object> attributes, boolean newLine)
    • writeArray

      private void writeArray(List<?> items, boolean newLine)
    • writeAll

      private <T> Runnable writeAll(Iterator<T> it, Consumer<T> writer)
    • writeAttribute

      private void writeAttribute(String name, Object value)
    • writeValue

      private void writeValue(Object value)
    • quote

      private String quote(String name)
    • escape

      private static String escape(CharSequence input)