Interface XContentGenerator

All Superinterfaces:
java.lang.AutoCloseable, java.io.Closeable, java.io.Flushable
All Known Implementing Classes:
CborXContentGenerator, JsonXContentGenerator, SmileXContentGenerator, YamlXContentGenerator

public interface XContentGenerator
extends java.io.Closeable, java.io.Flushable
  • Method Details

    • contentType

      XContentType contentType()
    • usePrettyPrint

      void usePrettyPrint()
    • isPrettyPrint

      boolean isPrettyPrint()
    • usePrintLineFeedAtEnd

      void usePrintLineFeedAtEnd()
    • writeStartObject

      void writeStartObject() throws java.io.IOException
      Throws:
      java.io.IOException
    • writeEndObject

      void writeEndObject() throws java.io.IOException
      Throws:
      java.io.IOException
    • writeStartArray

      void writeStartArray() throws java.io.IOException
      Throws:
      java.io.IOException
    • writeEndArray

      void writeEndArray() throws java.io.IOException
      Throws:
      java.io.IOException
    • writeFieldName

      void writeFieldName​(java.lang.String name) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNull

      void writeNull() throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNullField

      void writeNullField​(java.lang.String name) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeBooleanField

      void writeBooleanField​(java.lang.String name, boolean value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeBoolean

      void writeBoolean​(boolean value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, double value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(double value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, float value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(float value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, int value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(int value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, long value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(long value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(short value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(java.math.BigInteger value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, java.math.BigInteger value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumber

      void writeNumber​(java.math.BigDecimal value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeNumberField

      void writeNumberField​(java.lang.String name, java.math.BigDecimal value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeStringField

      void writeStringField​(java.lang.String name, java.lang.String value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeString

      void writeString​(java.lang.String value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeString

      void writeString​(char[] text, int offset, int len) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeUTF8String

      void writeUTF8String​(byte[] value, int offset, int length) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeBinaryField

      void writeBinaryField​(java.lang.String name, byte[] value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeBinary

      void writeBinary​(byte[] value) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeBinary

      void writeBinary​(byte[] value, int offset, int length) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeRawField

      @Deprecated void writeRawField​(java.lang.String name, java.io.InputStream value) throws java.io.IOException
      Deprecated.
      use writeRawField(String, InputStream, XContentType) to avoid content type auto-detection
      Writes a raw field with the value taken from the bytes in the stream
      Throws:
      java.io.IOException
    • writeRawField

      void writeRawField​(java.lang.String name, java.io.InputStream value, XContentType xContentType) throws java.io.IOException
      Writes a raw field with the value taken from the bytes in the stream
      Throws:
      java.io.IOException
    • writeRawValue

      void writeRawValue​(java.io.InputStream value, XContentType xContentType) throws java.io.IOException
      Writes a raw value taken from the bytes in the stream
      Throws:
      java.io.IOException
    • copyCurrentStructure

      void copyCurrentStructure​(XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • copyCurrentEvent

      default void copyCurrentEvent​(XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException
    • isClosed

      boolean isClosed()
      Returns true if this XContentGenerator has been closed. A closed generator can not do any more output.