org.elasticsearch.util.xcontent.builder
Class TextXContentBuilder

java.lang.Object
  extended by org.elasticsearch.util.xcontent.builder.XContentBuilder<TextXContentBuilder>
      extended by org.elasticsearch.util.xcontent.builder.TextXContentBuilder

public class TextXContentBuilder
extends XContentBuilder<TextXContentBuilder>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.elasticsearch.util.xcontent.builder.XContentBuilder
XContentBuilder.FieldCaseConversion
 
Field Summary
 
Fields inherited from class org.elasticsearch.util.xcontent.builder.XContentBuilder
builder, cachedStringBuilder, defaultDatePrinter, fieldCaseConversion, generator, globalFieldCaseConversion
 
Constructor Summary
TextXContentBuilder(XContent xContent)
           
 
Method Summary
 byte[] copiedBytes()
           
 TextXContentBuilder raw(byte[] json)
           
 TextXContentBuilder reset()
           
 java.lang.String string()
           
 byte[] unsafeBytes()
           
 int unsafeBytesLength()
          Call this AFTER unsafeBytes().
 FastCharArrayWriter unsafeChars()
           
 org.apache.lucene.util.UnicodeUtil.UTF8Result utf8()
          Returns the byte[] that represents the utf8 of the json written up until now.
 byte[] utf8copied()
          Returns a copied byte[] that represnts the utf8 o fthe json written up until now.
 
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
 

Constructor Detail

TextXContentBuilder

public TextXContentBuilder(XContent xContent)
                    throws java.io.IOException
Throws:
java.io.IOException
Method Detail

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