public interface XContentGenerator
extends java.io.Closeable, java.io.Flushable
| Modifier and Type | Method and Description |
|---|---|
XContentType |
contentType() |
void |
copyCurrentStructure(XContentParser parser) |
boolean |
isClosed()
Returns
true if this XContentGenerator has been closed. |
boolean |
isPrettyPrint() |
void |
usePrettyPrint() |
void |
usePrintLineFeedAtEnd() |
void |
writeBinary(byte[] value) |
void |
writeBinary(byte[] value,
int offset,
int length) |
void |
writeBinaryField(java.lang.String name,
byte[] value) |
void |
writeBoolean(boolean value) |
void |
writeBooleanField(java.lang.String name,
boolean value) |
void |
writeEndArray() |
void |
writeEndObject() |
void |
writeFieldName(java.lang.String name) |
void |
writeNull() |
void |
writeNullField(java.lang.String name) |
void |
writeNumber(double value) |
void |
writeNumber(float value) |
void |
writeNumber(int value) |
void |
writeNumber(long value) |
void |
writeNumber(short value) |
void |
writeNumberField(java.lang.String name,
double value) |
void |
writeNumberField(java.lang.String name,
float value) |
void |
writeNumberField(java.lang.String name,
int value) |
void |
writeNumberField(java.lang.String name,
long value) |
void |
writeRawField(java.lang.String name,
BytesReference value)
Deprecated.
use
writeRawField(String, BytesReference, XContentType) to avoid content type auto-detection |
void |
writeRawField(java.lang.String name,
BytesReference value,
XContentType xContentType)
Writes a raw field with the given bytes as the value
|
void |
writeRawField(java.lang.String name,
java.io.InputStream value)
Deprecated.
use
writeRawField(String, InputStream, XContentType) to avoid content type auto-detection |
void |
writeRawField(java.lang.String name,
java.io.InputStream value,
XContentType xContentType)
Writes a raw field with the value taken from the bytes in the stream
|
void |
writeRawValue(BytesReference value)
Deprecated.
use
writeRawValue(BytesReference, XContentType) to avoid content type auto-detection |
void |
writeRawValue(BytesReference value,
XContentType xContentType)
Writes a value with the source coming directly from the bytes
|
void |
writeStartArray() |
void |
writeStartObject() |
void |
writeString(char[] text,
int offset,
int len) |
void |
writeString(java.lang.String value) |
void |
writeStringField(java.lang.String name,
java.lang.String value) |
void |
writeUTF8String(byte[] value,
int offset,
int length) |
XContentType contentType()
void usePrettyPrint()
boolean isPrettyPrint()
void usePrintLineFeedAtEnd()
void writeStartObject()
throws java.io.IOException
java.io.IOExceptionvoid writeEndObject()
throws java.io.IOException
java.io.IOExceptionvoid writeStartArray()
throws java.io.IOException
java.io.IOExceptionvoid writeEndArray()
throws java.io.IOException
java.io.IOExceptionvoid writeFieldName(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionvoid writeNull()
throws java.io.IOException
java.io.IOExceptionvoid writeNullField(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionvoid writeBooleanField(java.lang.String name,
boolean value)
throws java.io.IOException
java.io.IOExceptionvoid writeBoolean(boolean value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumberField(java.lang.String name,
double value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumber(double value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumberField(java.lang.String name,
float value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumber(float value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumberField(java.lang.String name,
int value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumber(int value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumberField(java.lang.String name,
long value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumber(long value)
throws java.io.IOException
java.io.IOExceptionvoid writeNumber(short value)
throws java.io.IOException
java.io.IOExceptionvoid writeStringField(java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOExceptionvoid writeString(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionvoid writeString(char[] text,
int offset,
int len)
throws java.io.IOException
java.io.IOExceptionvoid writeUTF8String(byte[] value,
int offset,
int length)
throws java.io.IOException
java.io.IOExceptionvoid writeBinaryField(java.lang.String name,
byte[] value)
throws java.io.IOException
java.io.IOExceptionvoid writeBinary(byte[] value)
throws java.io.IOException
java.io.IOExceptionvoid writeBinary(byte[] value,
int offset,
int length)
throws java.io.IOException
java.io.IOException@Deprecated
void writeRawField(java.lang.String name,
java.io.InputStream value)
throws java.io.IOException
writeRawField(String, InputStream, XContentType) to avoid content type auto-detectionjava.io.IOExceptionvoid writeRawField(java.lang.String name,
java.io.InputStream value,
XContentType xContentType)
throws java.io.IOException
java.io.IOException@Deprecated
void writeRawField(java.lang.String name,
BytesReference value)
throws java.io.IOException
writeRawField(String, BytesReference, XContentType) to avoid content type auto-detectionjava.io.IOExceptionvoid writeRawField(java.lang.String name,
BytesReference value,
XContentType xContentType)
throws java.io.IOException
java.io.IOException@Deprecated void writeRawValue(BytesReference value) throws java.io.IOException
writeRawValue(BytesReference, XContentType) to avoid content type auto-detectionjava.io.IOExceptionvoid writeRawValue(BytesReference value, XContentType xContentType) throws java.io.IOException
java.io.IOExceptionvoid copyCurrentStructure(XContentParser parser) throws java.io.IOException
java.io.IOExceptionboolean isClosed()
true if this XContentGenerator has been closed. A closed generator can not do any more output.