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.IOExceptionpublic XContentBuilder(XContent xContent, OutputStream bos, String[] filters) throws IOException
close() when the builder is done with.IOExceptionpublic static void globalFieldCaseConversion(XContentBuilder.FieldCaseConversion globalFieldCaseConversion)
public static XContentBuilder builder(XContent xContent) throws IOException
IOExceptionpublic static XContentBuilder builder(XContent xContent, String[] filters) throws IOException
IOExceptionpublic 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
IOExceptionpublic XContentBuilder field(String name, ToXContent xContent, ToXContent.Params params) throws IOException
IOExceptionpublic XContentBuilder startObject(String name) throws IOException
IOExceptionpublic XContentBuilder startObject(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder startObject(XContentBuilderString name) throws IOException
IOExceptionpublic XContentBuilder startObject(XContentBuilderString name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder startObject() throws IOException
IOExceptionpublic XContentBuilder endObject() throws IOException
IOExceptionpublic XContentBuilder array(String name, String... values) throws IOException
IOExceptionpublic XContentBuilder array(XContentBuilderString name, String... values) throws IOException
IOExceptionpublic XContentBuilder array(String name, Object... values) throws IOException
IOExceptionpublic XContentBuilder array(XContentBuilderString name, Object... values) throws IOException
IOExceptionpublic XContentBuilder startArray(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder startArray(String name) throws IOException
IOExceptionpublic XContentBuilder startArray(XContentBuilderString name) throws IOException
IOExceptionpublic XContentBuilder startArray() throws IOException
IOExceptionpublic XContentBuilder endArray() throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder field(String name) throws IOException
IOExceptionpublic XContentBuilder field(String name, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder field(String name, char[] value, int offset, int length) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, char[] value, int offset, int length) throws IOException
IOExceptionpublic XContentBuilder field(String name, String value) throws IOException
IOExceptionpublic XContentBuilder field(String name, String value, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, String value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, String value, XContentBuilder.FieldCaseConversion conversion) throws IOException
IOExceptionpublic XContentBuilder field(String name, Integer value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Integer value) throws IOException
IOExceptionpublic XContentBuilder field(String name, int value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, int value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Long value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Long value) throws IOException
IOExceptionpublic XContentBuilder field(String name, long value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, long value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Float value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Float value) throws IOException
IOExceptionpublic XContentBuilder field(String name, float value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, float value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Double value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Double value) throws IOException
IOExceptionpublic XContentBuilder field(String name, double value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, double value) throws IOException
IOExceptionpublic XContentBuilder field(String name, BigDecimal value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, BigDecimal value) throws IOException
IOExceptionpublic XContentBuilder field(String name, BigDecimal value, int scale, RoundingMode rounding, boolean toDouble) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, BigDecimal value, int scale, RoundingMode rounding, boolean toDouble) throws IOException
IOExceptionpublic XContentBuilder field(String name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder field(XContentBuilderString name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder field(String name, BytesReference value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder field(XContentBuilderString name, BytesReference value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder utf8Field(XContentBuilderString name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.utf8Bytes() to read the value backIOExceptionpublic XContentBuilder utf8Field(String name, org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.utf8Bytes() to read the value backIOExceptionpublic XContentBuilder field(String name, Text value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Text value) throws IOException
IOExceptionpublic XContentBuilder field(String name, byte[] value, int offset, int length) throws IOException
IOExceptionpublic XContentBuilder field(String name, Map<String,Object> value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Map<String,Object> value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Iterable<?> value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Iterable<?> value) throws IOException
IOExceptionpublic XContentBuilder field(String name, boolean... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, boolean... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, String... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, String... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Object... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Object... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, int... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, int offset, int length, int... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, int... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, long... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, long... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, float... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, float... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, double... value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, double... value) throws IOException
IOExceptionpublic XContentBuilder field(String name, Object value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Object value) throws IOException
IOExceptionpublic XContentBuilder value(Object value) throws IOException
IOExceptionpublic XContentBuilder field(String name, boolean value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, boolean value) throws IOException
IOExceptionpublic XContentBuilder field(String name, byte[] value) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, byte[] value) throws IOException
IOExceptionpublic XContentBuilder field(String name, org.joda.time.ReadableInstant date) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, org.joda.time.ReadableInstant date) throws IOException
IOExceptionpublic XContentBuilder field(String name, org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOExceptionpublic XContentBuilder field(String name, Date date) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Date date) throws IOException
IOExceptionpublic XContentBuilder field(String name, Date date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOExceptionpublic XContentBuilder field(XContentBuilderString name, Date date, org.joda.time.format.DateTimeFormatter formatter) throws IOException
IOExceptionpublic XContentBuilder nullField(String name) throws IOException
IOExceptionpublic XContentBuilder nullField(XContentBuilderString name) throws IOException
IOExceptionpublic XContentBuilder nullValue() throws IOException
IOExceptionpublic XContentBuilder rawField(String fieldName, InputStream content) throws IOException
IOExceptionpublic XContentBuilder rawField(String fieldName, BytesReference content) throws IOException
IOExceptionpublic XContentBuilder rawValue(BytesReference content) throws IOException
IOExceptionpublic XContentBuilder timeValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, TimeValue timeValue) throws IOException
IOExceptionpublic XContentBuilder timeValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawTime) throws IOException
IOExceptionpublic XContentBuilder dateValueField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawTimestamp) throws IOException
IOExceptionpublic XContentBuilder timeValueField(String rawFieldName, String readableFieldName, TimeValue timeValue) throws IOException
IOExceptionpublic XContentBuilder timeValueField(String rawFieldName, String readableFieldName, long rawTime, TimeUnit timeUnit) throws IOException
IOExceptionpublic XContentBuilder dateValueField(String rawFieldName, String readableFieldName, long rawTimestamp) throws IOException
IOExceptionpublic XContentBuilder byteSizeField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, ByteSizeValue byteSizeValue) throws IOException
IOExceptionpublic XContentBuilder byteSizeField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, long rawSize) throws IOException
IOExceptionpublic XContentBuilder percentageField(XContentBuilderString rawFieldName, XContentBuilderString readableFieldName, double percentage) throws IOException
IOExceptionpublic XContentBuilder value(Boolean value) throws IOException
IOExceptionpublic XContentBuilder value(boolean value) throws IOException
IOExceptionpublic XContentBuilder value(org.joda.time.ReadableInstant date) throws IOException
IOExceptionpublic XContentBuilder value(org.joda.time.ReadableInstant date, org.joda.time.format.DateTimeFormatter dateTimeFormatter) throws IOException
IOExceptionpublic XContentBuilder value(Date date) throws IOException
IOExceptionpublic XContentBuilder value(Date date, org.joda.time.format.DateTimeFormatter dateTimeFormatter) throws IOException
IOExceptionpublic XContentBuilder value(Integer value) throws IOException
IOExceptionpublic XContentBuilder value(int value) throws IOException
IOExceptionpublic XContentBuilder value(Long value) throws IOException
IOExceptionpublic XContentBuilder value(long value) throws IOException
IOExceptionpublic XContentBuilder value(Float value) throws IOException
IOExceptionpublic XContentBuilder value(float value) throws IOException
IOExceptionpublic XContentBuilder value(Double value) throws IOException
IOExceptionpublic XContentBuilder value(double value) throws IOException
IOExceptionpublic XContentBuilder value(String value) throws IOException
IOExceptionpublic XContentBuilder value(byte[] value) throws IOException
IOExceptionpublic XContentBuilder value(byte[] value, int offset, int length) throws IOException
IOExceptionpublic XContentBuilder value(org.apache.lucene.util.BytesRef value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder value(BytesReference value) throws IOException
XContentParser.binaryValue() to read the value backIOExceptionpublic XContentBuilder value(Text value) throws IOException
IOExceptionpublic XContentBuilder map(Map<String,?> map) throws IOException
IOExceptionpublic XContentBuilder value(Map<String,Object> map) throws IOException
IOExceptionpublic XContentBuilder value(Iterable<?> value) throws IOException
IOExceptionpublic XContentBuilder latlon(String name, double lat, double lon) throws IOException
IOExceptionpublic XContentBuilder latlon(double lat, double lon) throws IOException
IOExceptionpublic XContentBuilder copyCurrentStructure(XContentParser parser) throws IOException
IOExceptionpublic XContentBuilder flush() throws IOException
IOExceptionpublic void close()
close in interface AutoCloseableclose in interface Releasablepublic XContentGenerator generator()
public BytesReference bytes()
bytes in interface BytesStreampublic String string() throws IOException
IOExceptionCopyright © 2009–2016. All rights reserved.