public class CsvMapper
extends com.fasterxml.jackson.databind.ObjectMapper
ObjectMapper
, with extended functionality to
produce CsvSchema
instances out of POJOs.Modifier and Type | Field and Description |
---|---|
protected LRUMap<com.fasterxml.jackson.databind.JavaType,CsvSchema> |
_typedSchemas
Simple caching for schema instances, given that they are relatively expensive
to construct; this one is for typed schemas
|
protected LRUMap<com.fasterxml.jackson.databind.JavaType,CsvSchema> |
_untypedSchemas
Simple caching for schema instances, given that they are relatively expensive
to construct; this one is for "loose" (non-typed) schemas
|
_defaultPrettyPrinter, _deserializationConfig, _deserializationContext, _injectableValues, _jsonFactory, _mixInAnnotations, _registeredModuleTypes, _rootDeserializers, _rootNames, _serializationConfig, _serializerFactory, _serializerProvider, _subtypeResolver, _typeFactory, DEFAULT_ANNOTATION_INTROSPECTOR, DEFAULT_BASE, STD_VISIBILITY_CHECKER
Modifier | Constructor and Description |
---|---|
|
CsvMapper() |
|
CsvMapper(CsvFactory f) |
protected |
CsvMapper(CsvMapper src)
Copy-constructor, mostly used to support
copy() . |
Modifier and Type | Method and Description |
---|---|
protected void |
_addSchemaProperties(CsvSchema.Builder builder,
com.fasterxml.jackson.databind.AnnotationIntrospector intr,
boolean typed,
com.fasterxml.jackson.databind.JavaType pojoType,
com.fasterxml.jackson.databind.util.NameTransformer unwrapper) |
protected CsvSchema.ColumnType |
_determineType(Class<?> propType) |
protected CsvObjectReader |
_newReader(com.fasterxml.jackson.databind.DeserializationConfig config) |
protected CsvObjectReader |
_newReader(com.fasterxml.jackson.databind.DeserializationConfig config,
com.fasterxml.jackson.databind.JavaType valueType,
Object valueToUpdate,
com.fasterxml.jackson.core.FormatSchema schema,
com.fasterxml.jackson.databind.InjectableValues injectableValues) |
protected CsvSchema |
_schemaFor(com.fasterxml.jackson.databind.JavaType pojoType,
LRUMap<com.fasterxml.jackson.databind.JavaType,CsvSchema> schemas,
boolean typed) |
CsvMapper |
configure(CsvGenerator.Feature f,
boolean state) |
CsvMapper |
configure(CsvParser.Feature f,
boolean state) |
CsvMapper |
copy() |
CsvMapper |
disable(CsvGenerator.Feature f) |
CsvMapper |
disable(CsvParser.Feature f) |
CsvMapper |
enable(CsvGenerator.Feature f) |
CsvMapper |
enable(CsvParser.Feature f) |
CsvFactory |
getFactory()
Overridden with more specific type, since factory we have
is always of type
CsvFactory |
CsvObjectReader |
readerWithSchemaFor(Class<?> pojoType)
Convenience method which is functionally equivalent to:
|
CsvObjectReader |
readerWithTypedSchemaFor(Class<?> pojoType)
Convenience method which is functionally equivalent to:
|
CsvSchema |
schema()
Convenience method that is same as
|
CsvSchema |
schemaFor(Class<?> pojoType) |
CsvSchema |
schemaFor(com.fasterxml.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.
|
CsvSchema |
schemaFor(com.fasterxml.jackson.core.type.TypeReference<?> pojoTypeRef) |
CsvSchema |
schemaWithHeader()
Convenience method that is same as
|
CsvSchema |
typedSchemaFor(Class<?> pojoType) |
CsvSchema |
typedSchemaFor(com.fasterxml.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.
|
CsvSchema |
typedSchemaFor(com.fasterxml.jackson.core.type.TypeReference<?> pojoTypeRef) |
<W extends com.fasterxml.jackson.databind.ObjectWriter> |
writerWithSchemaFor(Class<?> pojoType)
Convenience method which is functionally equivalent to:
|
<W extends com.fasterxml.jackson.databind.ObjectWriter> |
writerWithTypedSchemaFor(Class<?> pojoType)
Convenience method which is functionally equivalent to:
|
_checkInvalidCopy, _configAndWriteValue, _configAndWriteValue, _convert, _defaultPrettyPrinter, _findRootDeserializer, _initForReading, _newWriter, _newWriter, _newWriter, _readMapAndClose, _readValue, _serializerProvider, _unwrapAndDeserialize, _verifySchemaType, acceptJsonFormatVisitor, acceptJsonFormatVisitor, addHandler, addMixIn, addMixInAnnotations, canDeserialize, canDeserialize, canSerialize, canSerialize, clearProblemHandlers, configure, configure, configure, configure, configure, constructType, convertValue, convertValue, convertValue, createArrayNode, createDeserializationContext, createObjectNode, defaultClassIntrospector, disable, disable, disable, disable, disable, disable, disable, disableDefaultTyping, enable, enable, enable, enable, enable, enable, enable, enableDefaultTyping, enableDefaultTyping, enableDefaultTyping, enableDefaultTypingAsProperty, findAndRegisterModules, findMixInClassFor, findModules, findModules, generateJsonSchema, getDateFormat, getDeserializationConfig, getDeserializationContext, getJsonFactory, getNodeFactory, getPropertyNamingStrategy, getSerializationConfig, getSerializerFactory, getSerializerProvider, getSubtypeResolver, getTypeFactory, getVisibilityChecker, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, mixInCount, reader, reader, reader, reader, reader, reader, reader, reader, reader, reader, reader, readerForUpdating, readerWithView, 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, readValues, readValues, readValues, readValues, registerModule, registerModules, registerModules, registerSubtypes, registerSubtypes, setAnnotationIntrospector, setAnnotationIntrospectors, setBase64Variant, setConfig, setConfig, setDateFormat, setDefaultTyping, setFilters, setHandlerInstantiator, setInjectableValues, setLocale, setMixInAnnotations, setMixIns, setNodeFactory, setPropertyNamingStrategy, setSerializationInclusion, setSerializerFactory, setSerializerProvider, setSubtypeResolver, setTimeZone, setTypeFactory, setVisibility, setVisibilityChecker, treeAsTokens, treeToValue, valueToTree, version, writer, writer, writer, writer, writer, writer, writer, writer, writer, writer, writerFor, writerFor, writerFor, writerWithDefaultPrettyPrinter, writerWithType, writerWithType, writerWithType, writerWithView, writeTree, writeTree, writeValue, writeValue, writeValue, writeValue, writeValueAsBytes, writeValueAsString
protected final LRUMap<com.fasterxml.jackson.databind.JavaType,CsvSchema> _untypedSchemas
public CsvMapper()
public CsvMapper(CsvFactory f)
public CsvMapper copy()
copy
in class com.fasterxml.jackson.databind.ObjectMapper
protected CsvObjectReader _newReader(com.fasterxml.jackson.databind.DeserializationConfig config)
_newReader
in class com.fasterxml.jackson.databind.ObjectMapper
protected CsvObjectReader _newReader(com.fasterxml.jackson.databind.DeserializationConfig config, com.fasterxml.jackson.databind.JavaType valueType, Object valueToUpdate, com.fasterxml.jackson.core.FormatSchema schema, com.fasterxml.jackson.databind.InjectableValues injectableValues)
_newReader
in class com.fasterxml.jackson.databind.ObjectMapper
public CsvMapper configure(CsvGenerator.Feature f, boolean state)
public CsvMapper configure(CsvParser.Feature f, boolean state)
public CsvMapper enable(CsvGenerator.Feature f)
public CsvMapper enable(CsvParser.Feature f)
public CsvMapper disable(CsvGenerator.Feature f)
public CsvMapper disable(CsvParser.Feature f)
public CsvFactory getFactory()
CsvFactory
getFactory
in class com.fasterxml.jackson.databind.ObjectMapper
public CsvObjectReader readerWithSchemaFor(Class<?> pojoType)
reader(pojoType).withSchema(schemaFor(pojoType));that is, constructs a
ObjectReader
which both binds to
specified type and uses "loose" CsvSchema
introspected from
specified type (one without strict inferred typing).
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)public CsvObjectReader readerWithTypedSchemaFor(Class<?> pojoType)
reader(pojoType).withSchema(typedSchemaFor(pojoType));that is, constructs a
ObjectReader
which both binds to
specified type and uses "strict" CsvSchema
introspected from
specified type (one where typing is inferred).public <W extends com.fasterxml.jackson.databind.ObjectWriter> W writerWithSchemaFor(Class<?> pojoType)
writer(pojoType).with(schemaFor(pojoType));that is, constructs a
ObjectWriter
which both binds to
specified type and uses "loose" CsvSchema
introspected from
specified type (one without strict inferred typing).
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)public <W extends com.fasterxml.jackson.databind.ObjectWriter> W writerWithTypedSchemaFor(Class<?> pojoType)
writer(pojoType).with(typedSchemaFor(pojoType));that is, constructs a
ObjectWriter
which both binds to
specified type and uses "strict" CsvSchema
introspected from
specified type (one where typing is inferred).public CsvSchema schemaWithHeader()
CsvSchema.emptySchema().withHeader();and returns a
CsvSchema
instance that uses default configuration
with additional setting that the first content line contains intended
column names.public CsvSchema schema()
CsvSchema.emptySchema()that is, returns an "empty" Schema; one with default values and no column definitions.
public CsvSchema schemaFor(com.fasterxml.jackson.databind.JavaType pojoType)
public final CsvSchema schemaFor(com.fasterxml.jackson.core.type.TypeReference<?> pojoTypeRef)
public CsvSchema typedSchemaFor(com.fasterxml.jackson.databind.JavaType pojoType)
public final CsvSchema typedSchemaFor(com.fasterxml.jackson.core.type.TypeReference<?> pojoTypeRef)
protected CsvSchema _schemaFor(com.fasterxml.jackson.databind.JavaType pojoType, LRUMap<com.fasterxml.jackson.databind.JavaType,CsvSchema> schemas, boolean typed)
protected void _addSchemaProperties(CsvSchema.Builder builder, com.fasterxml.jackson.databind.AnnotationIntrospector intr, boolean typed, com.fasterxml.jackson.databind.JavaType pojoType, com.fasterxml.jackson.databind.util.NameTransformer unwrapper)
protected CsvSchema.ColumnType _determineType(Class<?> propType)
Copyright © 2014-2015 FasterXML. All Rights Reserved.