Class CsvFactory
java.lang.Object
com.fasterxml.jackson.core.TokenStreamFactory
com.fasterxml.jackson.core.JsonFactory
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.core.JsonFactory
com.fasterxml.jackson.core.JsonFactory.Feature -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected intprotected CsvSchema(package private) static final intBitfield (set of flags) of all generator features that are enabled by default.(package private) static final intBitfield (set of flags) of all parser features that are enabled by default.protected static final CsvSchemastatic final StringName used to identify CSV format.private static final longFields inherited from class com.fasterxml.jackson.core.JsonFactory
_byteSymbolCanonicalizer, _characterEscapes, _errorReportConfiguration, _factoryFeatures, _generatorDecorators, _generatorFeatures, _inputDecorator, _maximumNonEscapedChar, _objectCodec, _outputDecorator, _parserFeatures, _quoteChar, _recyclerPool, _rootCharSymbols, _rootValueSeparator, _streamReadConstraints, _streamWriteConstraints, DEFAULT_FACTORY_FEATURE_FLAGS, DEFAULT_GENERATOR_FEATURE_FLAGS, DEFAULT_PARSER_FEATURE_FLAGS, DEFAULT_QUOTE_CHAR, DEFAULT_ROOT_VALUE_SEPARATOR, FORMAT_NAME_JSON -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructor used to create factory instances.CsvFactory(com.fasterxml.jackson.core.ObjectCodec oc) protectedConstructors used byCsvFactoryBuilderfor instantiation.protectedCsvFactory(CsvFactory src, com.fasterxml.jackson.core.ObjectCodec oc) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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) static CsvFactoryBuilderbuilder()Main factory method to use for constructingCsvFactoryinstances with different configuration.booleanbooleancanUseSchema(com.fasterxml.jackson.core.FormatSchema schema) final CsvFactoryconfigure(CsvGenerator.Feature f, boolean state) Method for enabling or disabling specified generator feature (checkCsvGenerator.Featurefor list of features)final CsvFactoryconfigure(CsvParser.Feature f, boolean state) Method for enabling or disabling specified parser feature (checkCsvParser.Featurefor list of features)copy()createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc) This method assumes use of UTF-8 for encoding.createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) createGenerator(Writer out) createParser(byte[] data) createParser(byte[] data, int offset, int len) createParser(char[] data) createParser(char[] data, int offset, int len) createParser(File f) createParser(String doc) createParser(URL url) Method for disabling specified generator feature (checkCsvGenerator.Featurefor list of features)Method for disabling specified parser features (checkCsvParser.Featurefor list of features)Method for enabling specified generator features (checkCsvGenerator.Featurefor list of features)Method for enabling specified parser feature (checkCsvParser.Featurefor list of features)intintcom.fasterxml.jackson.core.format.MatchStrengthhasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) final booleanCheck whether specified generator feature is enabled.final booleanChecked whether specified parser feature is enabled.protected ObjectMethod that we need to override to actually make restoration go through constructors etc.rebuild()booleancom.fasterxml.jackson.core.Versionversion()Methods inherited from class com.fasterxml.jackson.core.JsonFactory
_checkInvalidCopy, _copy, _createContentReference, _createContentReference, _createContext, _createContext, _createNonBlockingContext, _createParser, _decorate, _decorate, _decorate, _decorate, _decorate, _decorate, _getBufferRecycler, _getRecyclerPool, canHandleBinaryNatively, canParseAsync, configure, configure, configure, createGenerator, createGenerator, createJsonGenerator, createJsonGenerator, createJsonGenerator, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createJsonParser, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, createParser, disable, disable, disable, enable, enable, enable, getCharacterEscapes, getCodec, getFactoryFeatures, getFormatReadFeatureType, getFormatWriteFeatureType, getGeneratorFeatures, getInputDecorator, getOutputDecorator, getParserFeatures, getRootValueSeparator, hasJSONFormat, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, requiresCustomCodec, setCharacterEscapes, setCodec, setErrorReportConfiguration, setInputDecorator, setOutputDecorator, setRecyclerPool, setRootValueSeparator, setStreamReadConstraints, setStreamWriteConstraints, streamReadConstraints, streamWriteConstraintsMethods inherited from class com.fasterxml.jackson.core.TokenStreamFactory
_checkRangeBoundsForByteArray, _checkRangeBoundsForCharArray, _createDataOutputWrapper, _fileInputStream, _fileOutputStream, _optimizedStreamFromURL, _reportRangeError
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
FORMAT_NAME_CSV
Name used to identify CSV format. (and returned bygetFormatName()- See Also:
-
DEFAULT_CSV_PARSER_FEATURE_FLAGS
static final int DEFAULT_CSV_PARSER_FEATURE_FLAGSBitfield (set of flags) of all parser features that are enabled by default. -
DEFAULT_CSV_GENERATOR_FEATURE_FLAGS
static final int DEFAULT_CSV_GENERATOR_FEATURE_FLAGSBitfield (set of flags) of all generator features that are enabled by default. -
DEFAULT_SCHEMA
-
_schema
-
_csvParserFeatures
protected int _csvParserFeatures -
_csvGeneratorFeatures
protected int _csvGeneratorFeatures
-
-
Constructor Details
-
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
- Since:
- 2.2.1
-
CsvFactory
Constructors used byCsvFactoryBuilderfor instantiation.- Since:
- 2.9
-
-
Method Details
-
rebuild
- Overrides:
rebuildin classcom.fasterxml.jackson.core.JsonFactory
-
builder
Main factory method to use for constructingCsvFactoryinstances with different configuration. -
copy
- Overrides:
copyin classcom.fasterxml.jackson.core.JsonFactory
-
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:
readResolvein classcom.fasterxml.jackson.core.JsonFactory
-
version
public com.fasterxml.jackson.core.Version version()- Specified by:
versionin interfacecom.fasterxml.jackson.core.Versioned- Overrides:
versionin classcom.fasterxml.jackson.core.JsonFactory
-
requiresPropertyOrdering
public boolean requiresPropertyOrdering()- Overrides:
requiresPropertyOrderingin classcom.fasterxml.jackson.core.JsonFactory
-
canUseCharArrays
public boolean canUseCharArrays()- Overrides:
canUseCharArraysin classcom.fasterxml.jackson.core.JsonFactory
-
getFormatName
- Overrides:
getFormatNamein classcom.fasterxml.jackson.core.JsonFactory
-
hasFormat
public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) throws IOException - Overrides:
hasFormatin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
canUseSchema
public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema) - Overrides:
canUseSchemain classcom.fasterxml.jackson.core.JsonFactory
-
configure
Method for enabling or disabling specified parser feature (checkCsvParser.Featurefor list of features) -
enable
Method for enabling specified parser feature (checkCsvParser.Featurefor list of features) -
disable
Method for disabling specified parser features (checkCsvParser.Featurefor list of features) -
isEnabled
Checked whether specified parser feature is enabled. -
getFormatParserFeatures
public int getFormatParserFeatures()- Overrides:
getFormatParserFeaturesin classcom.fasterxml.jackson.core.JsonFactory
-
configure
Method for enabling or disabling specified generator feature (checkCsvGenerator.Featurefor list of features) -
enable
Method for enabling specified generator features (checkCsvGenerator.Featurefor list of features) -
disable
Method for disabling specified generator feature (checkCsvGenerator.Featurefor list of features) -
isEnabled
Check whether specified generator feature is enabled. -
getFormatGeneratorFeatures
public int getFormatGeneratorFeatures()- Overrides:
getFormatGeneratorFeaturesin classcom.fasterxml.jackson.core.JsonFactory
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createParser
- Overrides:
createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public CsvGenerator createGenerator(OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException - Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
This method assumes use of UTF-8 for encoding.- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
- Overrides:
createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
createGenerator
public CsvGenerator createGenerator(File f, com.fasterxml.jackson.core.JsonEncoding enc) throws IOException - Overrides:
createGeneratorin classcom.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:
_createParserin classcom.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:
_createParserin classcom.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:
_createParserin classcom.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:
_createParserin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createGenerator
protected CsvGenerator _createGenerator(Writer out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException - Overrides:
_createGeneratorin classcom.fasterxml.jackson.core.JsonFactory- Throws:
IOException
-
_createUTF8Generator
protected CsvGenerator _createUTF8Generator(OutputStream out, com.fasterxml.jackson.core.io.IOContext ctxt) throws IOException - Overrides:
_createUTF8Generatorin classcom.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:
_createWriterin classcom.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
-