com.bazaarvoice.jackson.rison
Class RisonGenerator

java.lang.Object
  extended by com.fasterxml.jackson.core.JsonGenerator
      extended by com.fasterxml.jackson.core.base.GeneratorBase
          extended by com.bazaarvoice.jackson.rison.RisonGenerator
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Closeable, Flushable

public final class RisonGenerator
extends com.fasterxml.jackson.core.base.GeneratorBase

JsonGenerator that outputs Rison content using a Writer which handles character encoding.


Nested Class Summary
static class RisonGenerator.Feature
          Enumeration that defines all configurable features for Rison generators.
 
Field Summary
protected  com.fasterxml.jackson.core.io.IOContext _ioContext
           
protected  char[] _outputBuffer
          Intermediate buffer in which contents are buffered before being written using _writer.
protected  int _outputEnd
          End marker of the output buffer; one past the last valid position within the buffer.
protected  int _outputHead
          Pointer to the first buffered character to output
protected  int _outputTail
          Pointer to the position right beyond the last character to output (end marker; may point to position right beyond the end of the buffer)
protected  int _risonFeatures
           
protected  com.fasterxml.jackson.core.SerializableString _rootValueSeparator
           
protected  Writer _writer
           
protected static int SHORT_WRITE
           
 
Fields inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_cfgNumbersAsStrings, _closed, _features, _objectCodec, _writeContext
 
Fields inherited from class com.fasterxml.jackson.core.JsonGenerator
_cfgPrettyPrinter
 
Constructor Summary
RisonGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, int jsonFeatures, int risonFeatures, com.fasterxml.jackson.core.ObjectCodec codec, Writer w)
           
 
Method Summary
protected  void _flushBuffer()
           
protected  void _releaseBuffers()
           
protected  void _verifyValueWrite(String typeMsg)
           
protected  void _writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] input, int inputPtr, int inputEnd)
           
 void _writeFieldName(com.fasterxml.jackson.core.SerializableString name, boolean commaBefore)
           
protected  void _writeFieldName(String name, boolean commaBefore)
           
 void close()
           
 void flush()
           
 Object getOutputTarget()
           
 com.fasterxml.jackson.core.JsonGenerator setRootValueSeparator(com.fasterxml.jackson.core.SerializableString sep)
           
 com.fasterxml.jackson.core.Version version()
           
 void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant, byte[] data, int offset, int len)
           
 void writeBoolean(boolean state)
           
 void writeEndArray()
           
 void writeEndObject()
           
 void writeFieldName(com.fasterxml.jackson.core.SerializableString name)
           
 void writeFieldName(String name)
           
 void writeNull()
           
 void writeNumber(BigDecimal value)
           
 void writeNumber(BigInteger value)
           
 void writeNumber(double d)
           
 void writeNumber(float f)
           
 void writeNumber(int i)
           
 void writeNumber(long l)
           
 void writeNumber(String encodedValue)
           
 void writeRaw(char c)
           
 void writeRaw(char[] text, int offset, int len)
           
 void writeRaw(String text)
           
 void writeRaw(String text, int start, int len)
           
 void writeRawUTF8String(byte[] text, int offset, int length)
           
 void writeStartArray()
           
 void writeStartObject()
           
 void writeString(char[] text, int offset, int len)
           
 void writeString(com.fasterxml.jackson.core.SerializableString sstr)
           
 void writeString(String text)
           
 void writeUTF8String(byte[] text, int offset, int length)
           
 
Methods inherited from class com.fasterxml.jackson.core.base.GeneratorBase
_cantHappen, _reportError, _reportUnsupportedOperation, _throwInternal, _writeSimpleObject, copyCurrentEvent, copyCurrentStructure, disable, enable, getCodec, getOutputContext, isClosed, isEnabled, setCodec, useDefaultPrettyPrinter, writeBinary, writeObject, writeRawValue, writeRawValue, writeRawValue, writeTree
 
Methods inherited from class com.fasterxml.jackson.core.JsonGenerator
canUseSchema, configure, getCharacterEscapes, getHighestEscapedChar, getPrettyPrinter, getSchema, setCharacterEscapes, setHighestNonEscapedChar, setPrettyPrinter, setSchema, writeArrayFieldStart, writeBinary, writeBinary, writeBinary, writeBinaryField, writeBooleanField, writeNullField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeNumberField, writeObjectField, writeObjectFieldStart, writeRaw, writeStringField
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHORT_WRITE

protected static final int SHORT_WRITE
See Also:
Constant Field Values

_ioContext

protected final com.fasterxml.jackson.core.io.IOContext _ioContext

_writer

protected final Writer _writer

_risonFeatures

protected final int _risonFeatures

_rootValueSeparator

protected com.fasterxml.jackson.core.SerializableString _rootValueSeparator

_outputBuffer

protected char[] _outputBuffer
Intermediate buffer in which contents are buffered before being written using _writer.


_outputHead

protected int _outputHead
Pointer to the first buffered character to output


_outputTail

protected int _outputTail
Pointer to the position right beyond the last character to output (end marker; may point to position right beyond the end of the buffer)


_outputEnd

protected int _outputEnd
End marker of the output buffer; one past the last valid position within the buffer.

Constructor Detail

RisonGenerator

public RisonGenerator(com.fasterxml.jackson.core.io.IOContext ctxt,
                      int jsonFeatures,
                      int risonFeatures,
                      com.fasterxml.jackson.core.ObjectCodec codec,
                      Writer w)
Method Detail

version

public com.fasterxml.jackson.core.Version version()
Specified by:
version in interface com.fasterxml.jackson.core.Versioned
Overrides:
version in class com.fasterxml.jackson.core.base.GeneratorBase

getOutputTarget

public Object getOutputTarget()
Overrides:
getOutputTarget in class com.fasterxml.jackson.core.JsonGenerator

setRootValueSeparator

public com.fasterxml.jackson.core.JsonGenerator setRootValueSeparator(com.fasterxml.jackson.core.SerializableString sep)
Overrides:
setRootValueSeparator in class com.fasterxml.jackson.core.JsonGenerator

writeFieldName

public void writeFieldName(String name)
                    throws IOException,
                           com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeFieldName in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeFieldName

public void writeFieldName(com.fasterxml.jackson.core.SerializableString name)
                    throws IOException,
                           com.fasterxml.jackson.core.JsonGenerationException
Overrides:
writeFieldName in class com.fasterxml.jackson.core.base.GeneratorBase
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeStartArray

public void writeStartArray()
                     throws IOException,
                            com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeStartArray in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeEndArray

public void writeEndArray()
                   throws IOException,
                          com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeEndArray in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeStartObject

public void writeStartObject()
                      throws IOException,
                             com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeStartObject in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeEndObject

public void writeEndObject()
                    throws IOException,
                           com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeEndObject in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

_writeFieldName

protected void _writeFieldName(String name,
                               boolean commaBefore)
                        throws IOException,
                               com.fasterxml.jackson.core.JsonGenerationException
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

_writeFieldName

public void _writeFieldName(com.fasterxml.jackson.core.SerializableString name,
                            boolean commaBefore)
                     throws IOException,
                            com.fasterxml.jackson.core.JsonGenerationException
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeString

public void writeString(String text)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeString in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeString

public void writeString(char[] text,
                        int offset,
                        int len)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeString in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeString

public void writeString(com.fasterxml.jackson.core.SerializableString sstr)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Overrides:
writeString in class com.fasterxml.jackson.core.base.GeneratorBase
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeRawUTF8String

public void writeRawUTF8String(byte[] text,
                               int offset,
                               int length)
                        throws IOException,
                               com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeRawUTF8String in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeUTF8String

public void writeUTF8String(byte[] text,
                            int offset,
                            int length)
                     throws IOException,
                            com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeUTF8String in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeRaw

public void writeRaw(String text)
              throws IOException,
                     com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeRaw in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeRaw

public void writeRaw(String text,
                     int start,
                     int len)
              throws IOException,
                     com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeRaw in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeRaw

public void writeRaw(char[] text,
                     int offset,
                     int len)
              throws IOException,
                     com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeRaw in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeRaw

public void writeRaw(char c)
              throws IOException,
                     com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeRaw in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeBinary

public void writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant,
                        byte[] data,
                        int offset,
                        int len)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeBinary in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(int i)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(long l)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(BigInteger value)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(double d)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(float f)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(BigDecimal value)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNumber

public void writeNumber(String encodedValue)
                 throws IOException,
                        com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNumber in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeBoolean

public void writeBoolean(boolean state)
                  throws IOException,
                         com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeBoolean in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

writeNull

public void writeNull()
               throws IOException,
                      com.fasterxml.jackson.core.JsonGenerationException
Specified by:
writeNull in class com.fasterxml.jackson.core.JsonGenerator
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

_verifyValueWrite

protected final void _verifyValueWrite(String typeMsg)
                                throws IOException,
                                       com.fasterxml.jackson.core.JsonGenerationException
Specified by:
_verifyValueWrite in class com.fasterxml.jackson.core.base.GeneratorBase
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

flush

public void flush()
           throws IOException
Specified by:
flush in interface Flushable
Specified by:
flush in class com.fasterxml.jackson.core.base.GeneratorBase
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class com.fasterxml.jackson.core.base.GeneratorBase
Throws:
IOException

_releaseBuffers

protected void _releaseBuffers()
Specified by:
_releaseBuffers in class com.fasterxml.jackson.core.base.GeneratorBase

_writeBinary

protected void _writeBinary(com.fasterxml.jackson.core.Base64Variant b64variant,
                            byte[] input,
                            int inputPtr,
                            int inputEnd)
                     throws IOException,
                            com.fasterxml.jackson.core.JsonGenerationException
Throws:
IOException
com.fasterxml.jackson.core.JsonGenerationException

_flushBuffer

protected final void _flushBuffer()
                           throws IOException
Throws:
IOException


Copyright © 2013. All Rights Reserved.