org.elasticsearch.util.xcontent.json
Class JsonXContentGenerator

java.lang.Object
  extended by org.elasticsearch.util.xcontent.json.JsonXContentGenerator
All Implemented Interfaces:
XContentGenerator

public class JsonXContentGenerator
extends java.lang.Object
implements XContentGenerator


Constructor Summary
JsonXContentGenerator(org.codehaus.jackson.JsonGenerator generator)
           
 
Method Summary
 void close()
           
 XContentType contentType()
           
 void flush()
           
 void usePrettyPrint()
           
 void writeArrayFieldStart(java.lang.String fieldName)
           
 void writeBinary(byte[] data)
           
 void writeBinary(byte[] data, int offset, int len)
           
 void writeBinaryField(java.lang.String fieldName, byte[] data)
           
 void writeBoolean(boolean state)
           
 void writeBooleanField(java.lang.String fieldName, boolean value)
           
 void writeEndArray()
           
 void writeEndObject()
           
 void writeFieldName(java.lang.String name)
           
 void writeNull()
           
 void writeNullField(java.lang.String fieldName)
           
 void writeNumber(double d)
           
 void writeNumber(float f)
           
 void writeNumber(int v)
           
 void writeNumber(long v)
           
 void writeNumberField(java.lang.String fieldName, double value)
           
 void writeNumberField(java.lang.String fieldName, float value)
           
 void writeNumberField(java.lang.String fieldName, int value)
           
 void writeNumberField(java.lang.String fieldName, long value)
           
 void writeObjectFieldStart(java.lang.String fieldName)
           
 void writeRawFieldStart(java.lang.String fieldName)
           
 void writeStartArray()
           
 void writeStartObject()
           
 void writeString(char[] text, int offset, int len)
           
 void writeString(java.lang.String text)
           
 void writeStringField(java.lang.String fieldName, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonXContentGenerator

public JsonXContentGenerator(org.codehaus.jackson.JsonGenerator generator)
Method Detail

contentType

public XContentType contentType()
Specified by:
contentType in interface XContentGenerator

usePrettyPrint

public void usePrettyPrint()
Specified by:
usePrettyPrint in interface XContentGenerator

writeStartArray

public void writeStartArray()
                     throws java.io.IOException
Specified by:
writeStartArray in interface XContentGenerator
Throws:
java.io.IOException

writeEndArray

public void writeEndArray()
                   throws java.io.IOException
Specified by:
writeEndArray in interface XContentGenerator
Throws:
java.io.IOException

writeStartObject

public void writeStartObject()
                      throws java.io.IOException
Specified by:
writeStartObject in interface XContentGenerator
Throws:
java.io.IOException

writeEndObject

public void writeEndObject()
                    throws java.io.IOException
Specified by:
writeEndObject in interface XContentGenerator
Throws:
java.io.IOException

writeFieldName

public void writeFieldName(java.lang.String name)
                    throws java.io.IOException
Specified by:
writeFieldName in interface XContentGenerator
Throws:
java.io.IOException

writeString

public void writeString(java.lang.String text)
                 throws java.io.IOException
Specified by:
writeString in interface XContentGenerator
Throws:
java.io.IOException

writeString

public void writeString(char[] text,
                        int offset,
                        int len)
                 throws java.io.IOException
Specified by:
writeString in interface XContentGenerator
Throws:
java.io.IOException

writeBinary

public void writeBinary(byte[] data,
                        int offset,
                        int len)
                 throws java.io.IOException
Specified by:
writeBinary in interface XContentGenerator
Throws:
java.io.IOException

writeBinary

public void writeBinary(byte[] data)
                 throws java.io.IOException
Specified by:
writeBinary in interface XContentGenerator
Throws:
java.io.IOException

writeNumber

public void writeNumber(int v)
                 throws java.io.IOException
Specified by:
writeNumber in interface XContentGenerator
Throws:
java.io.IOException

writeNumber

public void writeNumber(long v)
                 throws java.io.IOException
Specified by:
writeNumber in interface XContentGenerator
Throws:
java.io.IOException

writeNumber

public void writeNumber(double d)
                 throws java.io.IOException
Specified by:
writeNumber in interface XContentGenerator
Throws:
java.io.IOException

writeNumber

public void writeNumber(float f)
                 throws java.io.IOException
Specified by:
writeNumber in interface XContentGenerator
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(boolean state)
                  throws java.io.IOException
Specified by:
writeBoolean in interface XContentGenerator
Throws:
java.io.IOException

writeNull

public void writeNull()
               throws java.io.IOException
Specified by:
writeNull in interface XContentGenerator
Throws:
java.io.IOException

writeStringField

public void writeStringField(java.lang.String fieldName,
                             java.lang.String value)
                      throws java.io.IOException
Specified by:
writeStringField in interface XContentGenerator
Throws:
java.io.IOException

writeBooleanField

public void writeBooleanField(java.lang.String fieldName,
                              boolean value)
                       throws java.io.IOException
Specified by:
writeBooleanField in interface XContentGenerator
Throws:
java.io.IOException

writeNullField

public void writeNullField(java.lang.String fieldName)
                    throws java.io.IOException
Specified by:
writeNullField in interface XContentGenerator
Throws:
java.io.IOException

writeNumberField

public void writeNumberField(java.lang.String fieldName,
                             int value)
                      throws java.io.IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
java.io.IOException

writeNumberField

public void writeNumberField(java.lang.String fieldName,
                             long value)
                      throws java.io.IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
java.io.IOException

writeNumberField

public void writeNumberField(java.lang.String fieldName,
                             double value)
                      throws java.io.IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
java.io.IOException

writeNumberField

public void writeNumberField(java.lang.String fieldName,
                             float value)
                      throws java.io.IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
java.io.IOException

writeBinaryField

public void writeBinaryField(java.lang.String fieldName,
                             byte[] data)
                      throws java.io.IOException
Specified by:
writeBinaryField in interface XContentGenerator
Throws:
java.io.IOException

writeArrayFieldStart

public void writeArrayFieldStart(java.lang.String fieldName)
                          throws java.io.IOException
Specified by:
writeArrayFieldStart in interface XContentGenerator
Throws:
java.io.IOException

writeObjectFieldStart

public void writeObjectFieldStart(java.lang.String fieldName)
                           throws java.io.IOException
Specified by:
writeObjectFieldStart in interface XContentGenerator
Throws:
java.io.IOException

writeRawFieldStart

public void writeRawFieldStart(java.lang.String fieldName)
                        throws java.io.IOException
Specified by:
writeRawFieldStart in interface XContentGenerator
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface XContentGenerator
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface XContentGenerator
Throws:
java.io.IOException