Top Description Inners Fields Constructors Methods
tools.jackson.dataformat.csv

public Class CsvMapper

extends ObjectMapper
Class Inheritance
Imports
java.util.Collection, .Objects, tools.jackson.core.type.TypeReference, tools.jackson.databind.*, tools.jackson.databind.cfg.MapperBuilder, .MapperBuilderState, tools.jackson.databind.introspect.AnnotatedMember, .BeanPropertyDefinition, tools.jackson.databind.util.NameTransformer, .SimpleLookupCache, .ViewMatcher

Specialized ObjectMapper, with extended functionality to produce CsvSchema instances out of POJOs.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CsvMapper.Builder

Base implementation for "Vanilla" ObjectMapper, used with CSV backend.

private static class
CsvMapper.SharedWrapper

Helper class to contain dynamically constructed "shared" instance of mapper, should one be needed via shared.

public static class
CsvMapper.ViewKey

Simple class in order to create a map key based on JavaType and a given view.

Field Summary

Modifier and TypeField and Description
protected final SimpleLookupCache<CsvMapper.ViewKey, CsvSchema>
_typedSchemas

Simple caching for schema instances, given that they are relatively expensive to construct; this one is for typed schemas

protected final SimpleLookupCache<CsvMapper.ViewKey, CsvSchema>
_untypedSchemas

Simple caching for schema instances, given that they are relatively expensive to construct; this one is for "loose" (non-typed) schemas

private static final long
Inherited from tools.jackson.databind.ObjectMapper:
_deserializationConfig_deserializationContexts_injectableValues_rootDeserializers_savedBuilderState_serializationConfig_serializationContexts_streamFactory_typeFactory

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
protected void
_addSchemaProperties(SerializationContext ctxt, CsvSchema.Builder builder, boolean typed, JavaType pojoType, NameTransformer unwrapper, Class<?> view)

protected CsvSchema.ColumnType
_determineType(Class<?> propType)

protected boolean
protected CsvSchema
_schemaFor(JavaType pojoType, SimpleLookupCache<CsvMapper.ViewKey, CsvSchema> schemas, boolean typed, Class<?> view)

public static CsvMapper.Builder
public static CsvMapper.Builder
builder(CsvFactory streamFactory)

public ObjectReader
readerWithSchemaFor(Class<?>
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)

pojoType
)

Convenience method which is functionally equivalent to:

  reader(pojoType).withSchema(schemaFor(pojoType));
public ObjectReader
readerWithTypedSchemaFor(Class<?> pojoType)

Convenience method which is functionally equivalent to:

  reader(pojoType).withSchema(typedSchemaFor(pojoType));
protected Object
public CsvMapper.Builder
rebuild()

Overrides tools.jackson.databind.ObjectMapper.rebuild.

Method for creating a new MapperBuilder for constructing differently configured ObjectMapper instance, starting with current configuration including base settings and registered modules.

public CsvSchema
schema()

Convenience method that is same as

   CsvSchema.emptySchema()
public CsvSchema
schemaFor(JavaType pojoType)

Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering.

public final CsvSchema
schemaFor(Class<?> pojoType)

public final CsvSchema
schemaFor(TypeReference<?> pojoTypeRef)

public CsvSchema
schemaForWithView(JavaType pojoType, Class<?> view)

public final CsvSchema
schemaForWithView(Class<?> pojoType, Class<?> view)

public final CsvSchema
schemaForWithView(TypeReference<?> pojoTypeRef, Class<?> view)

public CsvSchema
schemaWithHeader()

Convenience method that is same as

   CsvSchema.emptySchema().withHeader();
public static CsvMapper
shared()

Accessor method for getting globally shared "default" CsvMapper instance: one that has default configuration, no modules registered, no config overrides.

public CsvFactory
tokenStreamFactory()

Overrides tools.jackson.databind.ObjectMapper.tokenStreamFactory.

Overridden with more specific type, since factory we have is always of type CsvFactory

public CsvSchema
typedSchemaFor(JavaType pojoType)

Method that can be used to determine a CSV schema to use for given POJO type, using default serialization settings including ordering.

public final CsvSchema
typedSchemaFor(Class<?> pojoType)

public final CsvSchema
typedSchemaFor(TypeReference<?> pojoTypeRef)

public CsvSchema
public final CsvSchema
typedSchemaForWithView(Class<?> pojoType, Class<?> view)

public final CsvSchema
typedSchemaForWithView(TypeReference<?> pojoTypeRef, Class<?> view)

protected Object
public ObjectWriter
writerWithSchemaFor(Class<?>
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)

pojoType
)

Convenience method which is functionally equivalent to:

  writer(pojoType).with(schemaFor(pojoType));
public ObjectWriter
writerWithTypedSchemaFor(Class<?> pojoType)

Convenience method which is functionally equivalent to:

  writer(pojoType).with(typedSchemaFor(pojoType));
Inherited from tools.jackson.databind.ObjectMapper:
_assertNotNull_configAndWriteValue_convert_deserializationContext_deserializationContext_deserializationContext_findRootDeserializer_initForReading_newReader_newReader_newWriter_newWriter_newWriter_readMapAndClose_readTreeAndClose_readValue_serializationContext_serializationContext_verifyNoTrailingTokens_verifySchemaType_writeCloseableValueacceptJsonFormatVisitoracceptJsonFormatVisitoracceptJsonFormatVisitorbooleanNodeclearCachesconstructTypeconstructTypeconvertValueconvertValueconvertValuecreateArrayNodecreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateNonBlockingByteArrayParsercreateNonBlockingByteBufferParsercreateObjectNodecreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParserdeserializationConfiggetInjectableValuesgetNodeFactorygetTypeFactoryisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledmissingNodenullNodereaderreaderreaderreaderreaderreaderreaderreaderreaderreaderForreaderForreaderForreaderForArrayOfreaderForListOfreaderForMapOfreaderForUpdatingreaderWithViewreadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuesreadValuesreadValuesregisteredModulesserializationConfigstringNodetreeAsTokenstreeToValuetreeToValuetreeToValueupdateValuevalueToTreeversionwriterwriterwriterwriterwriterwriterwriterwriterwriterwriterwriterForwriterForwriterForwriterWithDefaultPrettyPrinterwriterWithViewwriteTreewriteValuewriteValuewriteValuewriteValuewriteValuewriteValuewriteValueAsByteswriteValueAsStringwriteValueIntoBuffer