public final class XContentBuilder extends Object implements BytesStream, Releasable
Modifier and Type | Class and Description |
---|---|
static class |
XContentBuilder.FieldCaseConversion |
Modifier and Type | Field and Description |
---|---|
static org.joda.time.format.DateTimeFormatter |
defaultDatePrinter |
protected static XContentBuilder.FieldCaseConversion |
globalFieldCaseConversion |
Constructor and Description |
---|
XContentBuilder(XContent xContent,
OutputStream bos)
Constructs a new builder using the provided xcontent and an OutputStream.
|
XContentBuilder(XContent xContent,
OutputStream bos,
String[] filters)
Constructs a new builder using the provided xcontent, an OutputStream and some filters.
|
public static final org.joda.time.format.DateTimeFormatter defaultDatePrinter
protected static XContentBuilder.FieldCaseConversion globalFieldCaseConversion
public XContentBuilder(XContent xContent, OutputStream bos) throws IOException
close()
when the builder is done with.IOException
public XContentBuilder(XContent xContent, OutputStream bos, String[] filters) throws IOException
close()
when the builder is done with.IOException
public static void globalFieldCaseConversion(XContentBuilder.FieldCaseConversion globalFieldCaseConversion)
public static XContentBuilder builder(XContent xContent) throws IOException
IOException
public static XContentBuilder builder(XContent xContent, String[] filters) throws IOException
IOException
public XContentBuilder fieldCaseConversion(XContentBuilder.FieldCaseConversion fieldCaseConversion)
public XContentType contentType()
public XContentBuilder prettyPrint()
public XContentBuilder lfAtEnd()
public XContentBuilder humanReadable(boolean humanReadable)
public boolean humanReadable()
public XContentBuilder field(String name, ToXContent xContent) throws IOException
IOException
public XContentBuilder field(String name, ToXContent xContent, ToXContent.Params params) throws IOException
IOException
public XContentBuilder startObject(String name) throws IOException
IOException
public XContentBuilder startObject(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder startObject(XContentBuilderString name) throws IOException
IOException
public XContentBuilder startObject(XContentBuilderString name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder startObject() throws IOException
IOException
public XContentBuilder endObject() throws IOException
IOException
public XContentBuilder array(String name, String... values) throws IOException
IOException
public XContentBuilder array(XContentBuilderString name, String... values) throws IOException
IOException
public XContentBuilder array(String name, Object... values) throws IOException
IOException
public XContentBuilder array(XContentBuilderString name, Object... values) throws IOException
IOException
public XContentBuilder startArray(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder startArray(String name) throws IOException
IOException
public XContentBuilder startArray(XContentBuilderString name) throws IOException
IOException
public XContentBuilder startArray() throws IOException
IOException
public XContentBuilder endArray() throws IOException
IOException
public XContentBuilder field(XContentBuilderString name) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder field(String name) throws IOException
IOException
public XContentBuilder field(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder field(String name, char[] value, int offset, int length) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, char[] value, int offset, int length) throws IOException
IOException
public XContentBuilder field(String name, String value) throws IOException
IOException
public XContentBuilder field(String name, String value, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, String value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, String value, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOException
public XContentBuilder field(String name, Integer value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Integer value) throws IOException
IOException
public XContentBuilder field(String name, int value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, int value) throws IOException
IOException
public XContentBuilder field(String name, Long value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Long value) throws IOException
IOException
public XContentBuilder field(String name, long value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, long value) throws IOException
IOException
public XContentBuilder field(String name, Float value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Float value) throws IOException
IOException
public XContentBuilder field(String name, float value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, float value) throws IOException
IOException
public XContentBuilder field(String name, Double value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Double value) throws IOException
IOException
public XContentBuilder field(String name, double value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, double value) throws IOException
IOException
public XContentBuilder field(String name, BigDecimal value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, BigDecimal value) throws IOException
IOException
public XContentBuilder field(String name, BigDecimal value, int scale, RoundingMode rounding, boolean toDouble) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, BigDecimal value, int scale, RoundingMode rounding, boolean toDouble) throws IOException
IOException
public XContentBuilder field(String name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder field(XContentBuilderString name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder field(String name, BytesReference value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder field(XContentBuilderString name, BytesReference value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder utf8Field(XContentBuilderString name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.utf8Bytes()
to read the value backIOException
public XContentBuilder utf8Field(String name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.utf8Bytes()
to read the value backIOException
public XContentBuilder field(String name, Text value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Text value) throws IOException
IOException
public XContentBuilder field(String name, byte[] value, int offset, int length) throws IOException
IOException
public XContentBuilder field(String name, Map<String,Object> value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Map<String,Object> value) throws IOException
IOException
public XContentBuilder field(String name, Iterable<?> value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Iterable<?> value) throws IOException
IOException
public XContentBuilder field(String name, boolean... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, boolean... value) throws IOException
IOException
public XContentBuilder field(String name, String... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, String... value) throws IOException
IOException
public XContentBuilder field(String name, Object... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Object... value) throws IOException
IOException
public XContentBuilder field(String name, int... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, int offset, int length, int... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, int... value) throws IOException
IOException
public XContentBuilder field(String name, long... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, long... value) throws IOException
IOException
public XContentBuilder field(String name, float... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, float... value) throws IOException
IOException
public XContentBuilder field(String name, double... value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, double... value) throws IOException
IOException
public XContentBuilder field(String name, Object value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Object value) throws IOException
IOException
public XContentBuilder value(Object value) throws IOException
IOException
public XContentBuilder field(String name, boolean value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, boolean value) throws IOException
IOException
public XContentBuilder field(String name, byte[] value) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, byte[] value) throws IOException
IOException
public XContentBuilder field(String name, org.joda.time.ReadableInstant date) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, org.joda.time.ReadableInstant date) throws IOException
IOException
public XContentBuilder field(String name, org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOException
public XContentBuilder field(String name, Date date) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Date date) throws IOException
IOException
public XContentBuilder field(String name, Date date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOException
public XContentBuilder field(XContentBuilderString name, Date date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOException
public XContentBuilder nullField(String name) throws IOException
IOException
public XContentBuilder nullField(XContentBuilderString name) throws IOException
IOException
public XContentBuilder nullValue() throws IOException
IOException
public XContentBuilder rawField(String fieldName, InputStream content) throws IOException
IOException
public XContentBuilder rawField(String fieldName, BytesReference content) throws IOException
IOException
public XContentBuilder rawValue(BytesReference content) throws IOException
IOException
public XContentBuilder timeValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, TimeValue timeValue) throws IOException
IOException
public XContentBuilder timeValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawTime) throws IOException
IOException
public XContentBuilder dateValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawTimestamp) throws IOException
IOException
public XContentBuilder timeValueField(String rawFieldName, String readableFieldName, TimeValue timeValue) throws IOException
IOException
public XContentBuilder timeValueField(String rawFieldName, String readableFieldName, long rawTime, TimeUnit timeUnit) throws IOException
IOException
public XContentBuilder dateValueField(String rawFieldName, String readableFieldName, long rawTimestamp) throws IOException
IOException
public XContentBuilder byteSizeField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, ByteSizeValue byteSizeValue) throws IOException
IOException
public XContentBuilder byteSizeField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawSize) throws IOException
IOException
public XContentBuilder percentageField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, double percentage) throws IOException
IOException
public XContentBuilder value(Boolean value) throws IOException
IOException
public XContentBuilder value(boolean value) throws IOException
IOException
public XContentBuilder value(org.joda.time.ReadableInstant date) throws IOException
IOException
public XContentBuilder value(org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter dateTimeFormatter) throws IOException
IOException
public XContentBuilder value(Date date) throws IOException
IOException
public XContentBuilder value(Date date, org.joda.time.format.DateTimeFormatter dateTimeFormatter) throws IOException
IOException
public XContentBuilder value(Integer value) throws IOException
IOException
public XContentBuilder value(int value) throws IOException
IOException
public XContentBuilder value(Long value) throws IOException
IOException
public XContentBuilder value(long value) throws IOException
IOException
public XContentBuilder value(Float value) throws IOException
IOException
public XContentBuilder value(float value) throws IOException
IOException
public XContentBuilder value(Double value) throws IOException
IOException
public XContentBuilder value(double value) throws IOException
IOException
public XContentBuilder value(String value) throws IOException
IOException
public XContentBuilder value(byte[] value) throws IOException
IOException
public XContentBuilder value(byte[] value, int offset, int length) throws IOException
IOException
public XContentBuilder value(org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder value(BytesReference value) throws IOException
XContentParser.binaryValue()
to read the value backIOException
public XContentBuilder value(Text value) throws IOException
IOException
public XContentBuilder map(Map<String,?> map) throws IOException
IOException
public XContentBuilder value(Map<String,Object> map) throws IOException
IOException
public XContentBuilder value(Iterable<?> value) throws IOException
IOException
public XContentBuilder latlon(String name, double lat, double lon) throws IOException
IOException
public XContentBuilder latlon(double lat, double lon) throws IOException
IOException
public XContentBuilder copyCurrentStructure(XContentParser parser) throws IOException
IOException
public XContentBuilder flush() throws IOException
IOException
public void close()
close
in interface AutoCloseable
close
in interface Releasable
public XContentGenerator generator()
public BytesReference bytes()
bytes
in interface BytesStream
public String string() throws IOException
IOException
Copyright © 2009–2016. All rights reserved.