org.elasticsearch.common.xcontent.json
Class JsonXContentGenerator

java.lang.Object
  extended by org.elasticsearch.common.xcontent.json.JsonXContentGenerator
All Implemented Interfaces:
XContentGenerator
Direct Known Subclasses:
SmileXContentGenerator, YamlXContentGenerator

public class JsonXContentGenerator
extends Object
implements XContentGenerator


Field Summary
protected  com.fasterxml.jackson.core.JsonGenerator generator
           
 
Constructor Summary
JsonXContentGenerator(com.fasterxml.jackson.core.JsonGenerator generator)
           
 
Method Summary
 void close()
           
 XContentType contentType()
           
 void copyCurrentStructure(XContentParser parser)
           
 void flush()
           
 void usePrettyPrint()
           
 void writeArrayFieldStart(String fieldName)
           
 void writeArrayFieldStart(XContentString fieldName)
           
 void writeBinary(byte[] data)
           
 void writeBinary(byte[] data, int offset, int len)
           
 void writeBinaryField(String fieldName, byte[] data)
           
 void writeBinaryField(XContentString fieldName, byte[] value)
           
 void writeBoolean(boolean state)
           
 void writeBooleanField(String fieldName, boolean value)
           
 void writeBooleanField(XContentString fieldName, boolean value)
           
 void writeEndArray()
           
 void writeEndObject()
           
 void writeFieldName(String name)
           
 void writeFieldName(XContentString name)
           
 void writeNull()
           
 void writeNullField(String fieldName)
           
 void writeNullField(XContentString fieldName)
           
 void writeNumber(double d)
           
 void writeNumber(float f)
           
 void writeNumber(int v)
           
 void writeNumber(long v)
           
 void writeNumberField(String fieldName, double value)
           
 void writeNumberField(String fieldName, float value)
           
 void writeNumberField(String fieldName, int value)
           
 void writeNumberField(String fieldName, long value)
           
 void writeNumberField(XContentString fieldName, double value)
           
 void writeNumberField(XContentString fieldName, float value)
           
 void writeNumberField(XContentString fieldName, int value)
           
 void writeNumberField(XContentString fieldName, long value)
           
 void writeObjectFieldStart(String fieldName)
           
 void writeObjectFieldStart(XContentString fieldName)
           
 void writeRawField(String fieldName, byte[] content, int offset, int length, OutputStream bos)
           
 void writeRawField(String fieldName, byte[] content, OutputStream bos)
           
 void writeRawField(String fieldName, BytesReference content, OutputStream bos)
           
 void writeRawField(String fieldName, InputStream content, OutputStream bos)
           
 void writeStartArray()
           
 void writeStartObject()
           
 void writeString(char[] text, int offset, int len)
           
 void writeString(String text)
           
 void writeStringField(String fieldName, String value)
           
 void writeStringField(XContentString fieldName, String value)
           
 void writeUTF8String(byte[] text, int offset, int length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

generator

protected final com.fasterxml.jackson.core.JsonGenerator generator
Constructor Detail

JsonXContentGenerator

public JsonXContentGenerator(com.fasterxml.jackson.core.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 IOException
Specified by:
writeStartArray in interface XContentGenerator
Throws:
IOException

writeEndArray

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

writeStartObject

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

writeEndObject

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

writeFieldName

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

writeFieldName

public void writeFieldName(XContentString name)
                    throws IOException
Specified by:
writeFieldName in interface XContentGenerator
Throws:
IOException

writeString

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

writeString

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

writeUTF8String

public void writeUTF8String(byte[] text,
                            int offset,
                            int length)
                     throws IOException
Specified by:
writeUTF8String in interface XContentGenerator
Throws:
IOException

writeBinary

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

writeBinary

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

writeNumber

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

writeNumber

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

writeNumber

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

writeNumber

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

writeBoolean

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

writeNull

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

writeStringField

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

writeStringField

public void writeStringField(XContentString fieldName,
                             String value)
                      throws IOException
Specified by:
writeStringField in interface XContentGenerator
Throws:
IOException

writeBooleanField

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

writeBooleanField

public void writeBooleanField(XContentString fieldName,
                              boolean value)
                       throws IOException
Specified by:
writeBooleanField in interface XContentGenerator
Throws:
IOException

writeNullField

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

writeNullField

public void writeNullField(XContentString fieldName)
                    throws IOException
Specified by:
writeNullField in interface XContentGenerator
Throws:
IOException

writeNumberField

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

writeNumberField

public void writeNumberField(XContentString fieldName,
                             int value)
                      throws IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
IOException

writeNumberField

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

writeNumberField

public void writeNumberField(XContentString fieldName,
                             long value)
                      throws IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
IOException

writeNumberField

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

writeNumberField

public void writeNumberField(XContentString fieldName,
                             double value)
                      throws IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
IOException

writeNumberField

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

writeNumberField

public void writeNumberField(XContentString fieldName,
                             float value)
                      throws IOException
Specified by:
writeNumberField in interface XContentGenerator
Throws:
IOException

writeBinaryField

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

writeBinaryField

public void writeBinaryField(XContentString fieldName,
                             byte[] value)
                      throws IOException
Specified by:
writeBinaryField in interface XContentGenerator
Throws:
IOException

writeArrayFieldStart

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

writeArrayFieldStart

public void writeArrayFieldStart(XContentString fieldName)
                          throws IOException
Specified by:
writeArrayFieldStart in interface XContentGenerator
Throws:
IOException

writeObjectFieldStart

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

writeObjectFieldStart

public void writeObjectFieldStart(XContentString fieldName)
                           throws IOException
Specified by:
writeObjectFieldStart in interface XContentGenerator
Throws:
IOException

writeRawField

public void writeRawField(String fieldName,
                          byte[] content,
                          OutputStream bos)
                   throws IOException
Specified by:
writeRawField in interface XContentGenerator
Throws:
IOException

writeRawField

public void writeRawField(String fieldName,
                          byte[] content,
                          int offset,
                          int length,
                          OutputStream bos)
                   throws IOException
Specified by:
writeRawField in interface XContentGenerator
Throws:
IOException

writeRawField

public void writeRawField(String fieldName,
                          InputStream content,
                          OutputStream bos)
                   throws IOException
Specified by:
writeRawField in interface XContentGenerator
Throws:
IOException

writeRawField

public void writeRawField(String fieldName,
                          BytesReference content,
                          OutputStream bos)
                   throws IOException
Specified by:
writeRawField in interface XContentGenerator
Throws:
IOException

copyCurrentStructure

public void copyCurrentStructure(XContentParser parser)
                          throws IOException
Specified by:
copyCurrentStructure in interface XContentGenerator
Throws:
IOException

flush

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

close

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


Copyright © 2009-2012. All Rights Reserved.