Class CsvMapper
java.lang.Object
tools.jackson.databind.ObjectMapper
tools.jackson.dataformat.csv.CsvMapper
- All Implemented Interfaces:
Serializable, tools.jackson.core.TreeCodec<tools.jackson.databind.JsonNode>, tools.jackson.core.Versioned
public class CsvMapper
extends tools.jackson.databind.ObjectMapper
Specialized
ObjectMapper, with extended functionality to
produce CsvSchema instances out of POJOs.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBase implementation for "Vanilla"ObjectMapper, used with CSV backend.private static final classHelper class to contain dynamically constructed "shared" instance of mapper, should one be needed viashared().static final classSimple class in order to create a map key based onJavaTypeand a given view. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> Simple caching for schema instances, given that they are relatively expensive to construct; this one is for typed schemasprotected final tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> Simple caching for schema instances, given that they are relatively expensive to construct; this one is for "loose" (non-typed) schemasprivate static final longFields inherited from class tools.jackson.databind.ObjectMapper
_deserializationConfig, _deserializationContexts, _injectableValues, _rootDeserializers, _savedBuilderState, _serializationConfig, _serializationContexts, _streamFactory, _typeFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void_addSchemaProperties(tools.jackson.databind.SerializationContext ctxt, CsvSchema.Builder builder, boolean typed, tools.jackson.databind.JavaType pojoType, tools.jackson.databind.util.NameTransformer unwrapper, Class<?> view) protected CsvSchema.ColumnType_determineType(Class<?> propType) protected boolean_nonPojoType(tools.jackson.databind.JavaType t) protected CsvSchema_schemaFor(tools.jackson.databind.JavaType pojoType, tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> schemas, boolean typed, Class<?> view) static CsvMapper.Builderbuilder()static CsvMapper.Builderbuilder(CsvFactory streamFactory) booleanbooleantools.jackson.databind.ObjectReaderreaderWithSchemaFor(Class<?> pojoType) Convenience method which is functionally equivalent to:tools.jackson.databind.ObjectReaderreaderWithTypedSchemaFor(Class<?> pojoType) Convenience method which is functionally equivalent to:protected Objectrebuild()schema()Convenience method that is same asfinal CsvSchemafinal CsvSchemaschemaFor(tools.jackson.core.type.TypeReference<?> pojoTypeRef) schemaFor(tools.jackson.databind.JavaType pojoType) Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering.final CsvSchemaschemaForWithView(Class<?> pojoType, Class<?> view) final CsvSchemaschemaForWithView(tools.jackson.core.type.TypeReference<?> pojoTypeRef, Class<?> view) schemaForWithView(tools.jackson.databind.JavaType pojoType, Class<?> view) Convenience method that is same asstatic CsvMappershared()Accessor method for getting globally shared "default"CsvMapperinstance: one that has default configuration, no modules registered, no config overrides.Overridden with more specific type, since factory we have is always of typeCsvFactoryfinal CsvSchematypedSchemaFor(Class<?> pojoType) final CsvSchematypedSchemaFor(tools.jackson.core.type.TypeReference<?> pojoTypeRef) typedSchemaFor(tools.jackson.databind.JavaType pojoType) Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering.final CsvSchematypedSchemaForWithView(Class<?> pojoType, Class<?> view) final CsvSchematypedSchemaForWithView(tools.jackson.core.type.TypeReference<?> pojoTypeRef, Class<?> view) typedSchemaForWithView(tools.jackson.databind.JavaType pojoType, Class<?> view) protected Objecttools.jackson.databind.ObjectWriterwriterWithSchemaFor(Class<?> pojoType) Convenience method which is functionally equivalent to:tools.jackson.databind.ObjectWriterwriterWithTypedSchemaFor(Class<?> pojoType) Convenience method which is functionally equivalent to:Methods inherited from class tools.jackson.databind.ObjectMapper
_assertNotNull, _configAndWriteValue, _convert, _deserializationContext, _deserializationContext, _deserializationContext, _findRootDeserializer, _initForReading, _newReader, _newReader, _newWriter, _newWriter, _newWriter, _readMapAndClose, _readTreeAndClose, _readValue, _serializationContext, _serializationContext, _verifyNoTrailingTokens, _verifySchemaType, _writeCloseableValue, acceptJsonFormatVisitor, acceptJsonFormatVisitor, acceptJsonFormatVisitor, booleanNode, clearCaches, constructType, constructType, convertValue, convertValue, convertValue, createArrayNode, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createGenerator, createNonBlockingByteArrayParser, createNonBlockingByteBufferParser, createObjectNode, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, createParser, deserializationConfig, getInjectableValues, getNodeFactory, getTypeFactory, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, missingNode, nullNode, reader, reader, reader, reader, reader, reader, reader, reader, reader, readerFor, readerFor, readerFor, readerForArrayOf, readerForListOf, readerForMapOf, readerForUpdating, readerWithView, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValues, readValues, readValues, registeredModules, serializationConfig, stringNode, treeAsTokens, treeToValue, treeToValue, treeToValue, treeToValue, treeToValue, treeToValue, updateValue, valueToTree, version, writer, writer, writer, writer, writer, writer, writer, writer, writer, writer, writerFor, writerFor, writerFor, writerWithDefaultPrettyPrinter, writerWithView, writeTree, writeValue, writeValue, writeValue, writeValue, writeValue, writeValue, writeValueAsBytes, writeValueAsString, writeValueIntoBuffer
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
_untypedSchemas
protected final tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> _untypedSchemasSimple caching for schema instances, given that they are relatively expensive to construct; this one is for "loose" (non-typed) schemas -
_typedSchemas
protected final tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> _typedSchemasSimple caching for schema instances, given that they are relatively expensive to construct; this one is for typed schemas
-
-
Constructor Details
-
CsvMapper
public CsvMapper() -
CsvMapper
-
CsvMapper
- Since:
- 3.0
-
-
Method Details
-
builder
-
builder
-
rebuild
- Overrides:
rebuildin classtools.jackson.databind.ObjectMapper
-
writeReplace
- Overrides:
writeReplacein classtools.jackson.databind.ObjectMapper
-
readResolve
- Overrides:
readResolvein classtools.jackson.databind.ObjectMapper
-
tokenStreamFactory
Overridden with more specific type, since factory we have is always of typeCsvFactory- Overrides:
tokenStreamFactoryin classtools.jackson.databind.ObjectMapper
-
isEnabled
-
isEnabled
-
readerWithSchemaFor
Convenience method which is functionally equivalent to:reader(pojoType).withSchema(schemaFor(pojoType));
that is, constructs aObjectReaderwhich both binds to specified type and uses "loose"CsvSchemaintrospected from specified type (one without strict inferred typing).- Parameters:
pojoType- Type used both for data-binding (result type) and for schema introspection. NOTE: must NOT be an array or Collection type, since these only make sense for data-binding (like arrays of objects to bind), but not for schema construction (no CSV types can be mapped to arrays or Collections)
-
readerWithTypedSchemaFor
Convenience method which is functionally equivalent to:reader(pojoType).withSchema(typedSchemaFor(pojoType));
that is, constructs aObjectReaderwhich both binds to specified type and uses "strict"CsvSchemaintrospected from specified type (one where typing is inferred). -
writerWithSchemaFor
Convenience method which is functionally equivalent to:writer(pojoType).with(schemaFor(pojoType));
that is, constructs aObjectWriterwhich both binds to specified type and uses "loose"CsvSchemaintrospected from specified type (one without strict inferred typing).- Parameters:
pojoType- Type used both for data-binding (result type) and for schema introspection. NOTE: must NOT be an array or Collection type, since these only make sense for data-binding (like arrays of objects to bind), but not for schema construction (no root-level CSV types can be mapped to arrays or Collections)
-
writerWithTypedSchemaFor
Convenience method which is functionally equivalent to:writer(pojoType).with(typedSchemaFor(pojoType));
that is, constructs aObjectWriterwhich both binds to specified type and uses "strict"CsvSchemaintrospected from specified type (one where typing is inferred). -
schemaWithHeader
-
schema
Convenience method that is same asCsvSchema.emptySchema()
that is, returns an "empty" Schema; one with default values and no column definitions. -
schemaFor
Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering. Definition will not be strictly typed (that is, all columns are just defined to be exposed as String tokens). -
schemaForWithView
-
schemaFor
-
schemaForWithView
-
schemaFor
-
schemaForWithView
-
typedSchemaFor
Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering. Definition WILL be strictly typed: that is, code will try to determine type limitations which may make parsing more efficient (especially for numeric types like java.lang.Integer). -
typedSchemaForWithView
-
typedSchemaFor
-
typedSchemaForWithView
-
typedSchemaFor
-
typedSchemaForWithView
-
_schemaFor
protected CsvSchema _schemaFor(tools.jackson.databind.JavaType pojoType, tools.jackson.databind.util.SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> schemas, boolean typed, Class<?> view) -
_nonPojoType
protected boolean _nonPojoType(tools.jackson.databind.JavaType t) -
_addSchemaProperties
protected void _addSchemaProperties(tools.jackson.databind.SerializationContext ctxt, CsvSchema.Builder builder, boolean typed, tools.jackson.databind.JavaType pojoType, tools.jackson.databind.util.NameTransformer unwrapper, Class<?> view) -
_determineType
-