public class JsonXContentGenerator extends 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,
OutputStream os,
String... filters) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
XContentType |
contentType() |
void |
copyCurrentStructure(XContentParser parser) |
protected void |
copyRawValue(BytesReference content,
XContent xContent) |
void |
flush() |
protected boolean |
inRoot() |
protected boolean |
isFiltered() |
protected boolean |
supportsRawWrites()
Whether this generator supports writing raw data directly
|
void |
usePrettyPrint() |
void |
usePrintLineFeedAtEnd() |
void |
writeArrayFieldStart(String fieldName) |
void |
writeArrayFieldStart(XContentString fieldName) |
void |
writeBinary(byte[] data) |
void |
writeBinary(byte[] data,
int offset,
int len) |
void |
writeBinaryField(String fieldName,
byte[] data) |
void |
writeBinaryField(XContentString fieldName,
byte[] value) |
void |
writeBoolean(boolean state) |
void |
writeBooleanField(String fieldName,
boolean value) |
void |
writeBooleanField(XContentString fieldName,
boolean value) |
void |
writeEndArray() |
void |
writeEndObject() |
void |
writeEndRaw() |
void |
writeFieldName(String name) |
void |
writeFieldName(XContentString name) |
void |
writeNull() |
void |
writeNullField(String fieldName) |
void |
writeNullField(XContentString fieldName) |
void |
writeNumber(double d) |
void |
writeNumber(float f) |
void |
writeNumber(int v) |
void |
writeNumber(long v) |
void |
writeNumberField(String fieldName,
double value) |
void |
writeNumberField(String fieldName,
float value) |
void |
writeNumberField(String fieldName,
int value) |
void |
writeNumberField(String fieldName,
long value) |
void |
writeNumberField(XContentString fieldName,
double value) |
void |
writeNumberField(XContentString fieldName,
float value) |
void |
writeNumberField(XContentString fieldName,
int value) |
void |
writeNumberField(XContentString fieldName,
long value) |
void |
writeObjectFieldStart(String fieldName) |
void |
writeObjectFieldStart(XContentString fieldName) |
void |
writeRawField(String fieldName,
BytesReference content) |
void |
writeRawField(String fieldName,
InputStream content) |
void |
writeRawValue(BytesReference content) |
void |
writeStartArray() |
void |
writeStartObject() |
void |
writeString(char[] text,
int offset,
int len) |
void |
writeString(String text) |
void |
writeStringField(String fieldName,
String value) |
void |
writeStringField(XContentString fieldName,
String value) |
void |
writeUTF8String(byte[] text,
int offset,
int length) |
protected final com.fasterxml.jackson.core.JsonGenerator generator
public JsonXContentGenerator(com.fasterxml.jackson.core.JsonGenerator jsonGenerator, OutputStream os, String... filters)
public XContentType contentType()
contentType
in interface XContentGenerator
public final void usePrettyPrint()
usePrettyPrint
in interface XContentGenerator
public void usePrintLineFeedAtEnd()
usePrintLineFeedAtEnd
in interface XContentGenerator
public void writeStartArray() throws IOException
writeStartArray
in interface XContentGenerator
IOException
public void writeEndArray() throws IOException
writeEndArray
in interface XContentGenerator
IOException
protected boolean isFiltered()
protected boolean inRoot()
public void writeStartObject() throws IOException
writeStartObject
in interface XContentGenerator
IOException
public void writeEndObject() throws IOException
writeEndObject
in interface XContentGenerator
IOException
public void writeFieldName(String name) throws IOException
writeFieldName
in interface XContentGenerator
IOException
public void writeFieldName(XContentString name) throws IOException
writeFieldName
in interface XContentGenerator
IOException
public void writeString(String text) throws IOException
writeString
in interface XContentGenerator
IOException
public void writeString(char[] text, int offset, int len) throws IOException
writeString
in interface XContentGenerator
IOException
public void writeUTF8String(byte[] text, int offset, int length) throws IOException
writeUTF8String
in interface XContentGenerator
IOException
public void writeBinary(byte[] data, int offset, int len) throws IOException
writeBinary
in interface XContentGenerator
IOException
public void writeBinary(byte[] data) throws IOException
writeBinary
in interface XContentGenerator
IOException
public void writeNumber(int v) throws IOException
writeNumber
in interface XContentGenerator
IOException
public void writeNumber(long v) throws IOException
writeNumber
in interface XContentGenerator
IOException
public void writeNumber(double d) throws IOException
writeNumber
in interface XContentGenerator
IOException
public void writeNumber(float f) throws IOException
writeNumber
in interface XContentGenerator
IOException
public void writeBoolean(boolean state) throws IOException
writeBoolean
in interface XContentGenerator
IOException
public void writeNull() throws IOException
writeNull
in interface XContentGenerator
IOException
public void writeStringField(String fieldName, String value) throws IOException
writeStringField
in interface XContentGenerator
IOException
public void writeStringField(XContentString fieldName, String value) throws IOException
writeStringField
in interface XContentGenerator
IOException
public void writeBooleanField(String fieldName, boolean value) throws IOException
writeBooleanField
in interface XContentGenerator
IOException
public void writeBooleanField(XContentString fieldName, boolean value) throws IOException
writeBooleanField
in interface XContentGenerator
IOException
public void writeNullField(String fieldName) throws IOException
writeNullField
in interface XContentGenerator
IOException
public void writeNullField(XContentString fieldName) throws IOException
writeNullField
in interface XContentGenerator
IOException
public void writeNumberField(String fieldName, int value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(XContentString fieldName, int value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(String fieldName, long value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(XContentString fieldName, long value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(String fieldName, double value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(XContentString fieldName, double value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(String fieldName, float value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeNumberField(XContentString fieldName, float value) throws IOException
writeNumberField
in interface XContentGenerator
IOException
public void writeBinaryField(String fieldName, byte[] data) throws IOException
writeBinaryField
in interface XContentGenerator
IOException
public void writeBinaryField(XContentString fieldName, byte[] value) throws IOException
writeBinaryField
in interface XContentGenerator
IOException
public void writeArrayFieldStart(String fieldName) throws IOException
writeArrayFieldStart
in interface XContentGenerator
IOException
public void writeArrayFieldStart(XContentString fieldName) throws IOException
writeArrayFieldStart
in interface XContentGenerator
IOException
public void writeObjectFieldStart(String fieldName) throws IOException
writeObjectFieldStart
in interface XContentGenerator
IOException
public void writeObjectFieldStart(XContentString fieldName) throws IOException
writeObjectFieldStart
in interface XContentGenerator
IOException
public void writeEndRaw()
public void writeRawField(String fieldName, InputStream content) throws IOException
writeRawField
in interface XContentGenerator
IOException
public final void writeRawField(String fieldName, BytesReference content) throws IOException
writeRawField
in interface XContentGenerator
IOException
public final void writeRawValue(BytesReference content) throws IOException
writeRawValue
in interface XContentGenerator
IOException
protected boolean supportsRawWrites()
protected void copyRawValue(BytesReference content, XContent xContent) throws IOException
IOException
public void copyCurrentStructure(XContentParser parser) throws IOException
copyCurrentStructure
in interface XContentGenerator
IOException
public void flush() throws IOException
flush
in interface XContentGenerator
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2009–2016. All rights reserved.