com.fasterxml.jackson.dataformat.csv
Class CsvFactory

java.lang.Object
  extended by com.fasterxml.jackson.core.JsonFactory
      extended by com.fasterxml.jackson.dataformat.csv.CsvFactory
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

public class CsvFactory
extends com.fasterxml.jackson.core.JsonFactory

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonFactory
com.fasterxml.jackson.core.JsonFactory.Feature
 
Field Summary
protected  int _csvGeneratorFeatures
           
protected  int _csvParserFeatures
           
protected  CsvSchema _schema
           
protected static char[] DEFAULT_LF
           
protected static CsvSchema DEFAULT_SCHEMA
           
static String FORMAT_NAME_CSV
          Name used to identify CSV format.
 
Fields inherited from class com.fasterxml.jackson.core.JsonFactory
_byteSymbolCanonicalizer, _characterEscapes, _factoryFeatures, _generatorFeatures, _inputDecorator, _objectCodec, _outputDecorator, _parserFeatures, _recyclerRef, _rootCharSymbols, _rootValueSeparator, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, FORMAT_NAME_JSON
 
Constructor Summary
  CsvFactory()
          Default constructor used to create factory instances.
protected CsvFactory(CsvFactory src, com.fasterxml.jackson.core.ObjectCodec oc)
           
  CsvFactory(com.fasterxml.jackson.core.ObjectCodec oc)
           
 
Method Summary
protected  com.fasterxml.jackson.core.io.IOContext _createContext(Object srcRef, boolean resourceManaged)
           
protected  CsvGenerator _createGenerator(com.fasterxml.jackson.core.io.IOContext ctxt, Writer out)
           
protected  CsvGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt)
           
protected  CsvParser _createParser(byte[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt)
           
protected  CsvParser _createParser(char[] data, int offset, int len, com.fasterxml.jackson.core.io.IOContext ctxt, boolean recyclable)
           
protected  CsvParser _createParser(InputStream in, com.fasterxml.jackson.core.io.IOContext ctxt)
          Overridable factory method that actually instantiates desired parser.
protected  CsvParser _createParser(Reader r, com.fasterxml.jackson.core.io.IOContext ctxt)
          Overridable factory method that actually instantiates desired parser.
protected  Reader _createReader(byte[] data, int offset, int len, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt)
           
protected  Reader _createReader(InputStream in, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt)
           
protected  CsvGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt)
           
protected  Writer _createWriter(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc, com.fasterxml.jackson.core.io.IOContext ctxt)
           
 boolean canUseCharArrays()
           
 boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)
           
 CsvFactory configure(CsvGenerator.Feature f, boolean state)
          Method for enabling or disabling specified generator feature (check CsvGenerator.Feature for list of features)
 CsvFactory configure(CsvParser.Feature f, boolean state)
          Method for enabling or disabling specified parser feature (check CsvParser.Feature for list of features)
 CsvFactory copy()
           
 CsvGenerator createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc)
           
 CsvGenerator createGenerator(OutputStream out)
          This method assumes use of UTF-8 for encoding.
 CsvGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)
           
 CsvGenerator createGenerator(Writer out)
           
 CsvParser createParser(byte[] data)
           
 CsvParser createParser(byte[] data, int offset, int len)
           
 CsvParser createParser(char[] data)
           
 CsvParser createParser(char[] data, int offset, int len)
           
 CsvParser createParser(File f)
           
 CsvParser createParser(InputStream in)
           
 CsvParser createParser(Reader r)
           
 CsvParser createParser(String doc)
           
 CsvParser createParser(URL url)
           
 CsvFactory disable(CsvGenerator.Feature f)
          Method for disabling specified generator feature (check CsvGenerator.Feature for list of features)
 CsvFactory disable(CsvParser.Feature f)
          Method for disabling specified parser features (check CsvParser.Feature for list of features)
 CsvFactory enable(CsvGenerator.Feature f)
          Method for enabling specified generator features (check CsvGenerator.Feature for list of features)
 CsvFactory enable(CsvParser.Feature f)
          Method for enabling specified parser feature (check CsvParser.Feature for list of features)
 String getFormatName()
           
 com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
          Sub-classes need to override this method (as of 1.8)
 boolean isEnabled(CsvGenerator.Feature f)
          Check whether specified generator feature is enabled.
 boolean isEnabled(CsvParser.Feature f)
          Checked whether specified parser feature is enabled.
protected  Object readResolve()
          Method that we need to override to actually make restoration go through constructors etc.
 boolean requiresPropertyOrdering()
           
 com.fasterxml.jackson.core.Version version()
           
 
Methods inherited from class com.fasterxml.jackson.core.JsonFactory
_checkInvalidCopy, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, _optimizedStreamFromURL, canHandleBinaryNatively, configure, configure, configure, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getFormatReadFeatureType, getFormatWriteFeatureType, getInputDecorator, getOutputDecorator, getRootValueSeparator, hasJSONFormat, isEnabled, isEnabled, isEnabled, requiresCustomCodec, setCharacterEscapes, setCodec, setInputDecorator, setOutputDecorator, setRootValueSeparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_NAME_CSV

public static final String FORMAT_NAME_CSV
Name used to identify CSV format. (and returned by getFormatName()

See Also:
Constant Field Values

DEFAULT_LF

protected static final char[] DEFAULT_LF

DEFAULT_SCHEMA

protected static final CsvSchema DEFAULT_SCHEMA

_schema

protected CsvSchema _schema

_csvParserFeatures

protected int _csvParserFeatures

_csvGeneratorFeatures

protected int _csvGeneratorFeatures
Constructor Detail

CsvFactory

public CsvFactory()
Default constructor used to create factory instances. Creation of a factory instance is a light-weight operation, but it is still a good idea to reuse limited number of factory instances (and quite often just a single instance): factories are used as context for storing some reused processing objects (such as symbol tables parsers use) and this reuse only works within context of a single factory instance.


CsvFactory

public CsvFactory(com.fasterxml.jackson.core.ObjectCodec oc)

CsvFactory

protected CsvFactory(CsvFactory src,
                     com.fasterxml.jackson.core.ObjectCodec oc)
Since:
2.2.1
Method Detail

copy

public CsvFactory copy()
Overrides:
copy in class com.fasterxml.jackson.core.JsonFactory

readResolve

protected Object readResolve()
Method that we need to override to actually make restoration go through constructors etc. Also: must be overridden by sub-classes as well.

Overrides:
readResolve in class com.fasterxml.jackson.core.JsonFactory

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.JsonFactory

requiresPropertyOrdering

public boolean requiresPropertyOrdering()
Overrides:
requiresPropertyOrdering in class com.fasterxml.jackson.core.JsonFactory

canUseCharArrays

public boolean canUseCharArrays()
Overrides:
canUseCharArrays in class com.fasterxml.jackson.core.JsonFactory

getFormatName

public String getFormatName()
Overrides:
getFormatName in class com.fasterxml.jackson.core.JsonFactory

hasFormat

public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)
                                                          throws IOException
Sub-classes need to override this method (as of 1.8)

Overrides:
hasFormat in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

canUseSchema

public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)
Overrides:
canUseSchema in class com.fasterxml.jackson.core.JsonFactory

configure

public final CsvFactory configure(CsvParser.Feature f,
                                  boolean state)
Method for enabling or disabling specified parser feature (check CsvParser.Feature for list of features)


enable

public CsvFactory enable(CsvParser.Feature f)
Method for enabling specified parser feature (check CsvParser.Feature for list of features)


disable

public CsvFactory disable(CsvParser.Feature f)
Method for disabling specified parser features (check CsvParser.Feature for list of features)


isEnabled

public final boolean isEnabled(CsvParser.Feature f)
Checked whether specified parser feature is enabled.


configure

public final CsvFactory configure(CsvGenerator.Feature f,
                                  boolean state)
Method for enabling or disabling specified generator feature (check CsvGenerator.Feature for list of features)


enable

public CsvFactory enable(CsvGenerator.Feature f)
Method for enabling specified generator features (check CsvGenerator.Feature for list of features)


disable

public CsvFactory disable(CsvGenerator.Feature f)
Method for disabling specified generator feature (check CsvGenerator.Feature for list of features)


isEnabled

public final boolean isEnabled(CsvGenerator.Feature f)
Check whether specified generator feature is enabled.


createParser

public CsvParser createParser(File f)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(URL url)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(InputStream in)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(Reader r)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(String doc)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(byte[] data)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(byte[] data,
                              int offset,
                              int len)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(char[] data)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createParser

public CsvParser createParser(char[] data,
                              int offset,
                              int len)
                       throws IOException
Overrides:
createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createGenerator

public CsvGenerator createGenerator(OutputStream out,
                                    com.fasterxml.jackson.core.JsonEncoding enc)
                             throws IOException
Overrides:
createGenerator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createGenerator

public CsvGenerator createGenerator(OutputStream out)
                             throws IOException
This method assumes use of UTF-8 for encoding.

Overrides:
createGenerator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createGenerator

public CsvGenerator createGenerator(Writer out)
                             throws IOException
Overrides:
createGenerator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

createGenerator

public CsvGenerator createGenerator(File f,
                                    com.fasterxml.jackson.core.JsonEncoding enc)
                             throws IOException
Overrides:
createGenerator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createParser

protected CsvParser _createParser(InputStream in,
                                  com.fasterxml.jackson.core.io.IOContext ctxt)
                           throws IOException
Overridable factory method that actually instantiates desired parser.

Overrides:
_createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createParser

protected CsvParser _createParser(byte[] data,
                                  int offset,
                                  int len,
                                  com.fasterxml.jackson.core.io.IOContext ctxt)
                           throws IOException
Overrides:
_createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createParser

protected CsvParser _createParser(Reader r,
                                  com.fasterxml.jackson.core.io.IOContext ctxt)
                           throws IOException
Overridable factory method that actually instantiates desired parser.

Overrides:
_createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createParser

protected CsvParser _createParser(char[] data,
                                  int offset,
                                  int len,
                                  com.fasterxml.jackson.core.io.IOContext ctxt,
                                  boolean recyclable)
                           throws IOException
Overrides:
_createParser in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createGenerator

protected CsvGenerator _createGenerator(Writer out,
                                        com.fasterxml.jackson.core.io.IOContext ctxt)
                                 throws IOException
Overrides:
_createGenerator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createUTF8Generator

protected CsvGenerator _createUTF8Generator(OutputStream out,
                                            com.fasterxml.jackson.core.io.IOContext ctxt)
                                     throws IOException
Overrides:
_createUTF8Generator in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createWriter

protected Writer _createWriter(OutputStream out,
                               com.fasterxml.jackson.core.JsonEncoding enc,
                               com.fasterxml.jackson.core.io.IOContext ctxt)
                        throws IOException
Overrides:
_createWriter in class com.fasterxml.jackson.core.JsonFactory
Throws:
IOException

_createGenerator

protected CsvGenerator _createGenerator(com.fasterxml.jackson.core.io.IOContext ctxt,
                                        Writer out)
                                 throws IOException
Throws:
IOException

_createReader

protected Reader _createReader(InputStream in,
                               com.fasterxml.jackson.core.JsonEncoding enc,
                               com.fasterxml.jackson.core.io.IOContext ctxt)
                        throws IOException
Throws:
IOException

_createReader

protected Reader _createReader(byte[] data,
                               int offset,
                               int len,
                               com.fasterxml.jackson.core.JsonEncoding enc,
                               com.fasterxml.jackson.core.io.IOContext ctxt)
                        throws IOException
Throws:
IOException

_createContext

protected com.fasterxml.jackson.core.io.IOContext _createContext(Object srcRef,
                                                                 boolean resourceManaged)
Overrides:
_createContext in class com.fasterxml.jackson.core.JsonFactory


Copyright © 2016 FasterXML. All rights reserved.