- All Superinterfaces:
AutoCloseable,Closeable,Flushable
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcopyCurrentEvent(XContentParser parser) voidcopyCurrentStructure(XContentParser parser) booleanisClosed()Returnstrueif this XContentGenerator has been closed.booleanvoidvoidvoidwriteBinary(byte[] value) voidwriteBinary(byte[] value, int offset, int length) voidwriteBinaryField(String name, byte[] value) voidwriteBoolean(boolean value) voidwriteBooleanField(String name, boolean value) voidwriteDirectField(String name, CheckedConsumer<OutputStream, IOException> writer) Write a field whose value is written directly to the output stream.voidvoidvoidwriteFieldName(String name) voidvoidwriteNullField(String name) voidwriteNumber(double value) voidwriteNumber(float value) voidwriteNumber(int value) voidwriteNumber(long value) voidwriteNumber(short value) voidwriteNumber(BigDecimal value) voidwriteNumber(BigInteger value) voidwriteNumberField(String name, double value) voidwriteNumberField(String name, float value) voidwriteNumberField(String name, int value) voidwriteNumberField(String name, long value) voidwriteNumberField(String name, BigDecimal value) voidwriteNumberField(String name, BigInteger value) voidwriteRawField(String name, InputStream value) Deprecated.voidwriteRawField(String name, InputStream value, XContentType xContentType) Writes a raw field with the value taken from the bytes in the streamvoidwriteRawValue(InputStream value, XContentType xContentType) Writes a raw value taken from the bytes in the streamvoidwriteRawValue(String value) Writes a raw value taken from a pre-rendered string representationvoidvoidvoidwriteString(char[] text, int offset, int len) voidwriteString(String value) voidwriteStringArray(String[] array) voidwriteStringField(String name, String value) voidwriteUTF8String(byte[] value, int offset, int length)
-
Method Details
-
contentType
XContentType contentType() -
usePrettyPrint
void usePrettyPrint() -
isPrettyPrint
boolean isPrettyPrint() -
usePrintLineFeedAtEnd
void usePrintLineFeedAtEnd() -
writeStartObject
- Throws:
IOException
-
writeEndObject
- Throws:
IOException
-
writeStartArray
- Throws:
IOException
-
writeEndArray
- Throws:
IOException
-
writeFieldName
- Throws:
IOException
-
writeNull
- Throws:
IOException
-
writeNullField
- Throws:
IOException
-
writeBooleanField
- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeNumber
- Throws:
IOException
-
writeNumberField
- Throws:
IOException
-
writeStringField
- Throws:
IOException
-
writeString
- Throws:
IOException
-
writeStringArray
- Throws:
IOException
-
writeString
- Throws:
IOException
-
writeUTF8String
- Throws:
IOException
-
writeBinaryField
- Throws:
IOException
-
writeBinary
- Throws:
IOException
-
writeBinary
- Throws:
IOException
-
writeRawField
Deprecated.usewriteRawField(String, InputStream, XContentType)to avoid content type auto-detectionWrites a raw field with the value taken from the bytes in the stream- Throws:
IOException
-
writeRawField
Writes a raw field with the value taken from the bytes in the stream- Throws:
IOException
-
writeRawValue
Writes a raw value taken from the bytes in the stream- Throws:
IOException
-
writeRawValue
Writes a raw value taken from a pre-rendered string representation- Throws:
IOException
-
copyCurrentStructure
- Throws:
IOException
-
writeDirectField
void writeDirectField(String name, CheckedConsumer<OutputStream, IOException> writer) throws IOExceptionWrite a field whose value is written directly to the output stream. As the content is copied as is, the writer must a valid XContent value (e.g., string is properly escaped and quoted)- Throws:
IOException
-
copyCurrentEvent
- Throws:
IOException
-
isClosed
boolean isClosed()Returnstrueif this XContentGenerator has been closed. A closed generator can not do any more output.
-
writeRawField(String, InputStream, XContentType)to avoid content type auto-detection