public class CsvEncoder extends Object
| Modifier and Type | Field and Description | 
|---|---|
| protected BufferedValue[] | _bufferedAnd if output comes in shuffled order we will need to do 
 bit of ordering. | 
| protected boolean | _bufferRecyclableFlag that indicates whether the  _outputBufferis recyclable (and
 needs to be returned to recycler once we are done) or not. | 
| protected boolean | _cfgAlwaysQuoteStrings | 
| protected char | _cfgColumnSeparator | 
| protected int | _cfgEscapeCharacter | 
| protected boolean | _cfgIncludeMissingTail | 
| protected char[] | _cfgLineSeparator | 
| protected int | _cfgLineSeparatorLength | 
| protected int | _cfgMaxQuoteCheckChars | 
| protected int | _cfgMinSafeCharLowest-valued character that is safe to output without using
 quotes around value, NOT including possible escape character. | 
| protected char[] | _cfgNullValue | 
| protected boolean | _cfgOptimalQuotingMarker flag used to determine if to do optimal (aka "strict") quoting
 checks or not (looser conservative check) | 
| protected int | _cfgQuoteCharacter | 
| protected int | _charsWrittenLet's keep track of how many bytes have been output, may prove useful
 when debugging. | 
| protected int | _columnCount | 
| protected int | _csvFeatures | 
| protected com.fasterxml.jackson.core.io.IOContext | _ioContext | 
| protected int | _lastBufferedIndex of the last buffered value | 
| protected int | _nextColumnToWriteIndex of column we expect to write next | 
| protected Writer | _outUnderlying  Writerused for output. | 
| protected char[] | _outputBufferIntermediate buffer in which contents are buffered before
 being written using  _out. | 
| protected int | _outputEndOffset to index after the last valid index in  _outputBuffer. | 
| protected int | _outputTailPointer to the next available char position in  _outputBuffer | 
| protected static int | MAX_QUOTE_CHECK | 
| protected BufferedValue[] | NO_BUFFERED | 
| protected static int | SHORT_WRITE | 
| Constructor and Description | 
|---|
| CsvEncoder(CsvEncoder base,
          CsvSchema newSchema) | 
| CsvEncoder(com.fasterxml.jackson.core.io.IOContext ctxt,
          int csvFeatures,
          Writer out,
          CsvSchema schema) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | _append(char[] ch) | 
| protected void | _buffer(int index,
       BufferedValue v) | 
| protected void | _flushBuffer() | 
| protected boolean | _mayNeedQuotes(String value,
              int length)Helper method that determines whether given String is likely
 to require quoting; check tries to optimize for speed. | 
| protected boolean | _needsQuotingLoose(String value)
 NOTE: final since checking is not expected to be changed here; override
 calling method ( _mayNeedQuotes) instead, if necessary. | 
| protected boolean | _needsQuotingLoose(String value,
                  int esc) | 
| protected boolean | _needsQuotingStrict(String value) | 
| protected boolean | _needsQuotingStrict(String value,
                   int esc) | 
| void | _releaseBuffers() | 
| void | _writeQuoted(String text) | 
| protected void | _writeQuoted(String text,
            char q,
            int i) | 
| void | _writeQuotedAndEscaped(String text,
                      char esc) | 
| protected void | _writeQuotedAndEscaped(String text,
                      char q,
                      char esc,
                      int i) | 
| protected void | appendColumnSeparator() | 
| protected void | appendNull() | 
| protected void | appendRawValue(String value) | 
| protected void | appendValue(boolean value) | 
| protected void | appendValue(double value) | 
| protected void | appendValue(float value) | 
| protected void | appendValue(int value) | 
| protected void | appendValue(long value) | 
| protected void | appendValue(String value) | 
| void | close(boolean autoClose) | 
| void | endRow() | 
| void | flush(boolean flushStream) | 
| int | getOutputBuffered()NOTE: while value does indeed indicate amount that has been written in the buffer,
 there may be more intermediate data that is buffered as values but not yet in
 buffer. | 
| Object | getOutputTarget() | 
| int | nextColumnIndex() | 
| CsvEncoder | overrideFormatFeatures(int feat) | 
| CsvEncoder | withSchema(CsvSchema schema) | 
| void | write(int columnIndex,
     boolean value) | 
| void | write(int columnIndex,
     char[] ch,
     int offset,
     int len) | 
| void | write(int columnIndex,
     double value) | 
| void | write(int columnIndex,
     float value) | 
| void | write(int columnIndex,
     int value) | 
| void | write(int columnIndex,
     long value) | 
| void | write(int columnIndex,
     String value) | 
| void | writeColumnName(String name) | 
| void | writeNonEscaped(int columnIndex,
               String rawValue) | 
| void | writeNull(int columnIndex) | 
| void | writeRaw(char c) | 
| void | writeRaw(char[] text,
        int offset,
        int len) | 
| void | writeRaw(String text) | 
| void | writeRaw(String text,
        int start,
        int len) | 
protected static final int SHORT_WRITE
protected static final int MAX_QUOTE_CHECK
protected final BufferedValue[] NO_BUFFERED
protected final com.fasterxml.jackson.core.io.IOContext _ioContext
protected final char _cfgColumnSeparator
protected final int _cfgQuoteCharacter
protected final int _cfgEscapeCharacter
protected final char[] _cfgLineSeparator
protected final char[] _cfgNullValue
protected final int _cfgLineSeparatorLength
protected int _cfgMaxQuoteCheckChars
protected final int _cfgMinSafeChar
protected int _csvFeatures
protected boolean _cfgOptimalQuoting
protected boolean _cfgIncludeMissingTail
protected boolean _cfgAlwaysQuoteStrings
protected int _columnCount
protected int _nextColumnToWrite
protected BufferedValue[] _buffered
protected int _lastBuffered
protected char[] _outputBuffer
_out.protected boolean _bufferRecyclable
_outputBuffer is recyclable (and
 needs to be returned to recycler once we are done) or not.protected int _outputTail
_outputBufferprotected final int _outputEnd
_outputBuffer.
 Typically same as length of the buffer.protected int _charsWritten
public CsvEncoder(com.fasterxml.jackson.core.io.IOContext ctxt,
          int csvFeatures,
          Writer out,
          CsvSchema schema)
public CsvEncoder(CsvEncoder base, CsvSchema newSchema)
public CsvEncoder withSchema(CsvSchema schema)
public CsvEncoder overrideFormatFeatures(int feat)
public Object getOutputTarget()
public int getOutputBuffered()
public int nextColumnIndex()
public final void write(int columnIndex,
         String value)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         char[] ch,
         int offset,
         int len)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         int value)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         long value)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         float value)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         double value)
                 throws IOException
IOExceptionpublic final void write(int columnIndex,
         boolean value)
                 throws IOException
IOExceptionpublic final void writeNonEscaped(int columnIndex,
                   String rawValue)
                           throws IOException
IOExceptionpublic final void writeNull(int columnIndex)
                     throws IOException
IOExceptionpublic final void writeColumnName(String name) throws IOException
IOExceptionpublic void endRow()
            throws IOException
IOExceptionprotected void appendValue(String value) throws IOException
IOExceptionprotected void appendRawValue(String value) throws IOException
IOExceptionprotected void appendValue(int value)
                    throws IOException
IOExceptionprotected void appendValue(long value)
                    throws IOException
IOExceptionprotected void appendValue(float value)
                    throws IOException
IOExceptionprotected void appendValue(double value)
                    throws IOException
IOExceptionprotected void appendValue(boolean value)
                    throws IOException
IOExceptionprotected void appendNull()
                   throws IOException
IOExceptionprotected void _append(char[] ch)
                throws IOException
IOExceptionprotected void appendColumnSeparator()
                              throws IOException
IOExceptionpublic void writeRaw(String text) throws IOException
IOExceptionpublic void writeRaw(String text, int start, int len) throws IOException
IOExceptionpublic void writeRaw(char[] text,
            int offset,
            int len)
              throws IOException
IOExceptionpublic void writeRaw(char c)
              throws IOException
IOExceptionpublic void _writeQuoted(String text) throws IOException
IOExceptionprotected void _writeQuoted(String text, char q, int i) throws IOException
IOExceptionpublic void _writeQuotedAndEscaped(String text, char esc) throws IOException
IOExceptionprotected void _writeQuotedAndEscaped(String text, char q, char esc, int i) throws IOException
IOExceptionpublic void flush(boolean flushStream)
           throws IOException
IOExceptionpublic void close(boolean autoClose)
           throws IOException
IOExceptionprotected boolean _mayNeedQuotes(String value, int length)
protected final boolean _needsQuotingLoose(String value)
 NOTE: final since checking is not expected to be changed here; override
 calling method (_mayNeedQuotes) instead, if necessary.
protected final boolean _needsQuotingLoose(String value, int esc)
protected boolean _needsQuotingStrict(String value)
protected boolean _needsQuotingStrict(String value, int esc)
protected void _buffer(int index,
           BufferedValue v)
protected void _flushBuffer()
                     throws IOException
IOExceptionpublic void _releaseBuffers()
Copyright © 2016 FasterXML. All rights reserved.