org.elasticsearch.util.xcontent.builder
Class TextXContentBuilder
java.lang.Object
org.elasticsearch.util.xcontent.builder.XContentBuilder<TextXContentBuilder>
org.elasticsearch.util.xcontent.builder.TextXContentBuilder
public class TextXContentBuilder
- extends XContentBuilder<TextXContentBuilder>
Methods inherited from class org.elasticsearch.util.xcontent.builder.XContentBuilder |
array, array, close, contentType, endArray, endObject, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, field, fieldCaseConversion, flush, globalFieldCaseConversion, map, nullField, nullValue, prettyPrint, rawField, startArray, startArray, startObject, startObject, value, value, value, value, value, value, value, value, value, value, value, value, value, value, value, value, value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextXContentBuilder
public TextXContentBuilder(XContent xContent)
throws java.io.IOException
- Throws:
java.io.IOException
raw
public TextXContentBuilder raw(byte[] json)
throws java.io.IOException
- Specified by:
raw
in class XContentBuilder<TextXContentBuilder>
- Throws:
java.io.IOException
reset
public TextXContentBuilder reset()
throws java.io.IOException
- Specified by:
reset
in class XContentBuilder<TextXContentBuilder>
- Throws:
java.io.IOException
string
public java.lang.String string()
throws java.io.IOException
- Specified by:
string
in class XContentBuilder<TextXContentBuilder>
- Throws:
java.io.IOException
unsafeChars
public FastCharArrayWriter unsafeChars()
throws java.io.IOException
- Throws:
java.io.IOException
unsafeBytes
public byte[] unsafeBytes()
throws java.io.IOException
- Specified by:
unsafeBytes
in class XContentBuilder<TextXContentBuilder>
- Throws:
java.io.IOException
unsafeBytesLength
public int unsafeBytesLength()
- Call this AFTER
unsafeBytes()
.
- Specified by:
unsafeBytesLength
in class XContentBuilder<TextXContentBuilder>
copiedBytes
public byte[] copiedBytes()
throws java.io.IOException
- Specified by:
copiedBytes
in class XContentBuilder<TextXContentBuilder>
- Throws:
java.io.IOException
utf8
public org.apache.lucene.util.UnicodeUtil.UTF8Result utf8()
throws java.io.IOException
- Returns the byte[] that represents the utf8 of the json written up until now.
Note, the result is shared within this instance, so copy the byte array if needed
or use
utf8copied()
.
- Throws:
java.io.IOException
utf8copied
public byte[] utf8copied()
throws java.io.IOException
- Returns a copied byte[] that represnts the utf8 o fthe json written up until now.
- Throws:
java.io.IOException