public class JsonXContentGenerator extends java.lang.Object implements XContentGenerator
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.core.JsonGenerator |
generator
Generator used to write content
|
Constructor and Description |
---|
JsonXContentGenerator(com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
java.io.OutputStream os,
java.util.Set<java.lang.String> includes,
java.util.Set<java.lang.String> excludes) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
XContentType |
contentType() |
void |
copyCurrentStructure(XContentParser parser) |
protected void |
copyRawValue(BytesReference content,
XContent xContent) |
void |
flush() |
boolean |
isClosed()
Returns
true if this XContentGenerator has been closed. |
boolean |
isPrettyPrint() |
protected boolean |
supportsRawWrites()
Whether this generator supports writing raw data directly
|
void |
usePrettyPrint() |
void |
usePrintLineFeedAtEnd() |
void |
writeBinary(byte[] value) |
void |
writeBinary(byte[] value,
int offset,
int len) |
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 |
writeEndRaw() |
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 content)
Writes a raw field with the given bytes as the value
|
void |
writeRawField(java.lang.String name,
BytesReference content,
XContentType contentType)
Writes a raw field with the given bytes as the value
|
void |
writeRawField(java.lang.String name,
java.io.InputStream content)
Writes a raw field with the value taken from the bytes in the stream
|
void |
writeRawField(java.lang.String name,
java.io.InputStream content,
XContentType contentType)
Writes a raw field with the value taken from the bytes in the stream
|
void |
writeRawValue(BytesReference content)
Writes a value with the source coming directly from the bytes
|
void |
writeRawValue(BytesReference content,
XContentType contentType)
Writes a value with the source coming directly from the bytes
|
void |
writeStartArray() |
void |
writeStartObject() |
void |
writeString(char[] value,
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) |
protected final com.fasterxml.jackson.core.JsonGenerator generator
public JsonXContentGenerator(com.fasterxml.jackson.core.JsonGenerator jsonGenerator, java.io.OutputStream os, java.util.Set<java.lang.String> includes, java.util.Set<java.lang.String> excludes)
public XContentType contentType()
contentType
in interface XContentGenerator
public final void usePrettyPrint()
usePrettyPrint
in interface XContentGenerator
public boolean isPrettyPrint()
isPrettyPrint
in interface XContentGenerator
public void usePrintLineFeedAtEnd()
usePrintLineFeedAtEnd
in interface XContentGenerator
public void writeStartObject() throws java.io.IOException
writeStartObject
in interface XContentGenerator
java.io.IOException
public void writeEndObject() throws java.io.IOException
writeEndObject
in interface XContentGenerator
java.io.IOException
public void writeStartArray() throws java.io.IOException
writeStartArray
in interface XContentGenerator
java.io.IOException
public void writeEndArray() throws java.io.IOException
writeEndArray
in interface XContentGenerator
java.io.IOException
public void writeFieldName(java.lang.String name) throws java.io.IOException
writeFieldName
in interface XContentGenerator
java.io.IOException
public void writeNull() throws java.io.IOException
writeNull
in interface XContentGenerator
java.io.IOException
public void writeNullField(java.lang.String name) throws java.io.IOException
writeNullField
in interface XContentGenerator
java.io.IOException
public void writeBooleanField(java.lang.String name, boolean value) throws java.io.IOException
writeBooleanField
in interface XContentGenerator
java.io.IOException
public void writeBoolean(boolean value) throws java.io.IOException
writeBoolean
in interface XContentGenerator
java.io.IOException
public void writeNumberField(java.lang.String name, double value) throws java.io.IOException
writeNumberField
in interface XContentGenerator
java.io.IOException
public void writeNumber(double value) throws java.io.IOException
writeNumber
in interface XContentGenerator
java.io.IOException
public void writeNumberField(java.lang.String name, float value) throws java.io.IOException
writeNumberField
in interface XContentGenerator
java.io.IOException
public void writeNumber(float value) throws java.io.IOException
writeNumber
in interface XContentGenerator
java.io.IOException
public void writeNumberField(java.lang.String name, int value) throws java.io.IOException
writeNumberField
in interface XContentGenerator
java.io.IOException
public void writeNumber(int value) throws java.io.IOException
writeNumber
in interface XContentGenerator
java.io.IOException
public void writeNumberField(java.lang.String name, long value) throws java.io.IOException
writeNumberField
in interface XContentGenerator
java.io.IOException
public void writeNumber(long value) throws java.io.IOException
writeNumber
in interface XContentGenerator
java.io.IOException
public void writeNumber(short value) throws java.io.IOException
writeNumber
in interface XContentGenerator
java.io.IOException
public void writeStringField(java.lang.String name, java.lang.String value) throws java.io.IOException
writeStringField
in interface XContentGenerator
java.io.IOException
public void writeString(java.lang.String value) throws java.io.IOException
writeString
in interface XContentGenerator
java.io.IOException
public void writeString(char[] value, int offset, int len) throws java.io.IOException
writeString
in interface XContentGenerator
java.io.IOException
public void writeUTF8String(byte[] value, int offset, int length) throws java.io.IOException
writeUTF8String
in interface XContentGenerator
java.io.IOException
public void writeBinaryField(java.lang.String name, byte[] value) throws java.io.IOException
writeBinaryField
in interface XContentGenerator
java.io.IOException
public void writeBinary(byte[] value) throws java.io.IOException
writeBinary
in interface XContentGenerator
java.io.IOException
public void writeBinary(byte[] value, int offset, int len) throws java.io.IOException
writeBinary
in interface XContentGenerator
java.io.IOException
public void writeEndRaw()
public void writeRawField(java.lang.String name, java.io.InputStream content) throws java.io.IOException
XContentGenerator
writeRawField
in interface XContentGenerator
java.io.IOException
public void writeRawField(java.lang.String name, java.io.InputStream content, XContentType contentType) throws java.io.IOException
XContentGenerator
writeRawField
in interface XContentGenerator
java.io.IOException
public final void writeRawField(java.lang.String name, BytesReference content) throws java.io.IOException
XContentGenerator
writeRawField
in interface XContentGenerator
java.io.IOException
public final void writeRawField(java.lang.String name, BytesReference content, XContentType contentType) throws java.io.IOException
XContentGenerator
writeRawField
in interface XContentGenerator
java.io.IOException
public final void writeRawValue(BytesReference content) throws java.io.IOException
XContentGenerator
writeRawValue
in interface XContentGenerator
java.io.IOException
public final void writeRawValue(BytesReference content, XContentType contentType) throws java.io.IOException
XContentGenerator
writeRawValue
in interface XContentGenerator
java.io.IOException
protected boolean supportsRawWrites()
protected void copyRawValue(BytesReference content, XContent xContent) throws java.io.IOException
java.io.IOException
public void copyCurrentStructure(XContentParser parser) throws java.io.IOException
copyCurrentStructure
in interface XContentGenerator
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public boolean isClosed()
XContentGenerator
true
if this XContentGenerator has been closed. A closed generator can not do any more output.isClosed
in interface XContentGenerator