Top Inners Fields Constructors Methods
com.fasterxml.jackson.dataformat.protobuf

public Class ProtobufMapper

extends ObjectMapper
Class Inheritance
Imports
java.io.File, .IOException, .InputStream, java.net.URL, java.util.concurrent.locks.ReentrantLock, com.fasterxml.jackson.core.Version, com.fasterxml.jackson.core.type.TypeReference, com.fasterxml.jackson.databind.JavaType, .JsonMappingException, .ObjectMapper, com.fasterxml.jackson.databind.cfg.MapperBuilder, com.fasterxml.jackson.dataformat.protobuf.schema.DescriptorLoader, .FileDescriptorSet, .ProtobufSchema, .ProtobufSchemaLoader, com.fasterxml.jackson.dataformat.protobuf.schemagen.ProtobufSchemaGenerator

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
ProtobufMapper.Builder

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

Field Summary

Modifier and TypeField and Description
protected volatile DescriptorLoader
_descriptorLoader

Lazily constructed instance of DescriptorLoader, used for loading structured protoc definitions from multiple files.

private final ReentrantLock
protected ProtobufSchemaLoader
private static final long
Inherited from com.fasterxml.jackson.databind.ObjectMapper:
_coercionConfigs_configOverrides_deserializationConfig_deserializationContext_injectableValues_jsonFactory_mixIns_registeredModuleTypes_rootDeserializers_serializationConfig_serializerFactory_serializerProvider_subtypeResolver_typeFactoryDEFAULT_ANNOTATION_INTROSPECTORDEFAULT_BASE

Constructor Summary

AccessConstructor and Description
public
public
protected

Method Summary

Modifier and TypeMethod and Description
public static ProtobufMapper.Builder
public static ProtobufMapper.Builder
builder(ProtobufFactory streamFactory)

public ProtobufMapper
copy()

Overrides com.fasterxml.jackson.databind.ObjectMapper.copy.

Method for creating a new ObjectMapper instance that has same initial configuration as this instance.

public DescriptorLoader
descriptorLoader()

Accessors that may be used instead of convenience loadDescriptorSet methods, if alternate sources need to be used.

public ProtobufSchema

Returns:

Generated ProtobufSchema
generateSchemaFor
(JavaType
Resolved type to generate ProtobufSchema for
type
)

Convenience method for constructing protoc definition that matches given Java type.

public ProtobufSchema

Returns:

Generated ProtobufSchema
generateSchemaFor
(Class<?>
Type-erased type to generate ProtobufSchema for
type
)

Convenience method for constructing protoc definition that matches given Java type.

public ProtobufSchema

Returns:

Generated ProtobufSchema
generateSchemaFor
(TypeReference<?>
Type to generate ProtobufSchema for
type
)

Convenience method for constructing protoc definition that matches given Java type.

public ProtobufFactory
getFactory()

Overrides com.fasterxml.jackson.databind.ObjectMapper.getFactory.

Accessor for finding underlying data format factory (JsonFactory) codec will use for data binding.

public FileDescriptorSet
public FileDescriptorSet
public FileDescriptorSet
public ProtobufSchemaLoader
schemaLoader()

Accessor for reusable ProtobufSchemaLoader which can be used for loading protoc definitions from files and other external sources.

public void
public Version
version()

Overrides com.fasterxml.jackson.databind.ObjectMapper.version.

Implements com.fasterxml.jackson.core.Versioned.version.

Method that will return version information stored in and read from jar that contains this class.

Inherited from com.fasterxml.jackson.databind.ObjectMapper:
_assertNotNull_checkInvalidCopy_configAndWriteValue_constructDefaultTypeResolverBuilder_convert_findRootDeserializer_initForReading_newReader_newReader_newWriter_newWriter_newWriter_readMapAndClose_readTreeAndClose_readValue_serializerProvider_verifyNoTrailingTokens_verifySchemaType_writeValueAndCloseacceptJsonFormatVisitoracceptJsonFormatVisitoractivateDefaultTypingactivateDefaultTypingactivateDefaultTypingactivateDefaultTypingAsPropertyaddHandleraddMixInaddMixInAnnotationscanDeserializecanDeserializecanSerializecanSerializeclearProblemHandlerscoercionConfigDefaultscoercionConfigForcoercionConfigForconfigOverrideconfigureconfigureconfigureconfigureconfigureconfigureconstructTypeconstructTypeconvertValueconvertValueconvertValuecopyWithcreateArrayNodecreateDeserializationContextcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateNonBlockingByteArrayParsercreateObjectNodecreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParserdeactivateDefaultTypingdefaultClassIntrospectordisabledisabledisabledisabledisabledisabledisabledisableDefaultTypingenableenableenableenableenableenableenableenableDefaultTypingenableDefaultTypingenableDefaultTypingenableDefaultTypingAsPropertyfindAndRegisterModulesfindMixInClassForfindModulesfindModulesgenerateJsonSchemagetDateFormatgetDeserializationConfiggetDeserializationContextgetInjectableValuesgetNodeFactorygetPolymorphicTypeValidatorgetPropertyNamingStrategygetRegisteredModuleIdsgetSerializationConfiggetSerializerFactorygetSerializerProvidergetSerializerProviderInstancegetSubtypeResolvergetTypeFactorygetVisibilityCheckerisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledmissingNodemixInCountnullNodereaderreaderreaderreaderreaderreaderreaderreaderreaderreaderreaderreaderForreaderForreaderForreaderForArrayOfreaderForListOfreaderForMapOfreaderForUpdatingreaderWithViewreadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuesreadValuesreadValuesreadValuesregisterModuleregisterModulesregisterModulesregisterSubtypesregisterSubtypesregisterSubtypessetAccessorNamingsetAnnotationIntrospectorsetAnnotationIntrospectorssetBase64VariantsetCacheProvidersetConfigsetConfigsetConstructorDetectorsetDateFormatsetDefaultAttributessetDefaultLeniencysetDefaultMergeablesetDefaultPrettyPrintersetDefaultPropertyInclusionsetDefaultPropertyInclusionsetDefaultSetterInfosetDefaultTypingsetDefaultVisibilitysetFilterProvidersetFilterssetHandlerInstantiatorsetInjectableValuessetLocalesetMixInAnnotationssetMixInResolversetMixInssetNodeFactorysetPolymorphicTypeValidatorsetPropertyInclusionsetPropertyNamingStrategysetSerializationInclusionsetSerializerFactorysetSerializerProvidersetSubtypeResolversetTimeZonesetTypeFactorysetVisibilitysetVisibilitysetVisibilityCheckertokenStreamFactorytreeAsTokenstreeToValuetreeToValuetreeToValueupdateValuevalueToTreewriterwriterwriterwriterwriterwriterwriterwriterwriterwriterwriterForwriterForwriterForwriterWithDefaultPrettyPrinterwriterWithTypewriterWithTypewriterWithTypewriterWithViewwriteTreewriteTreewriteValuewriteValuewriteValuewriteValuewriteValuewriteValueAsByteswriteValueAsString

Field Detail

_descriptorLoaderback to summary
protected volatile DescriptorLoader _descriptorLoader

Lazily constructed instance of DescriptorLoader, used for loading structured protoc definitions from multiple files.

Since
2.9
_descriptorLockback to summary
private final ReentrantLock _descriptorLock
_schemaLoaderback to summary
protected ProtobufSchemaLoader _schemaLoader
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.ObjectMapper.serialVersionUID.

Constructor Detail

ProtobufMapperback to summary
public ProtobufMapper()
ProtobufMapperback to summary
public ProtobufMapper(ProtobufFactory f)
ProtobufMapperback to summary
protected ProtobufMapper(ProtobufMapper src)

Method Detail

builderback to summary
public static ProtobufMapper.Builder builder()
Since
2.10
builderback to summary
public static ProtobufMapper.Builder builder(ProtobufFactory streamFactory)
Since
2.10
copyback to summary
public ProtobufMapper copy()

Overrides com.fasterxml.jackson.databind.ObjectMapper.copy.

Doc from com.fasterxml.jackson.databind.ObjectMapper.copy.

Method for creating a new ObjectMapper instance that has same initial configuration as this instance. Note that this also requires making a copy of the underlying JsonFactory instance.

Method is typically used when multiple, differently configured mappers are needed. Although configuration is shared, cached serializers and deserializers are NOT shared, which means that the new instance may be re-configured before use; meaning that it behaves the same way as if an instance was constructed from scratch.

Annotations
@Override
descriptorLoaderback to summary
public DescriptorLoader descriptorLoader() throws IOException

Accessors that may be used instead of convenience loadDescriptorSet methods, if alternate sources need to be used.

Since
2.9
generateSchemaForback to summary
public ProtobufSchema generateSchemaFor(JavaType type) throws JsonMappingException

Convenience method for constructing protoc definition that matches given Java type. Uses ProtobufSchemaGenerator for generation.

Parameters
type:JavaType

Resolved type to generate ProtobufSchema for

Returns:ProtobufSchema

Generated ProtobufSchema

generateSchemaForback to summary
public ProtobufSchema generateSchemaFor(Class<?> type) throws JsonMappingException

Convenience method for constructing protoc definition that matches given Java type. Uses ProtobufSchemaGenerator for generation.

Parameters
type:Class<?>

Type-erased type to generate ProtobufSchema for

Returns:ProtobufSchema

Generated ProtobufSchema

Since
2.8
generateSchemaForback to summary
public ProtobufSchema generateSchemaFor(TypeReference<?> type) throws JsonMappingException

Convenience method for constructing protoc definition that matches given Java type. Uses ProtobufSchemaGenerator for generation.

Parameters
type:TypeReference<?>

Type to generate ProtobufSchema for

Returns:ProtobufSchema

Generated ProtobufSchema

Since
2.10
getFactoryback to summary
public ProtobufFactory getFactory()

Overrides com.fasterxml.jackson.databind.ObjectMapper.getFactory.

Doc from com.fasterxml.jackson.core.ObjectCodec.getFactory.

Accessor for finding underlying data format factory (JsonFactory) codec will use for data binding.

Returns:ProtobufFactory

Underlying JsonFactory instance

Annotations
@Override
loadDescriptorSetback to summary
public FileDescriptorSet loadDescriptorSet(URL src) throws IOException
Since
2.9
loadDescriptorSetback to summary
public FileDescriptorSet loadDescriptorSet(File src) throws IOException
Since
2.9
loadDescriptorSetback to summary
public FileDescriptorSet loadDescriptorSet(InputStream src) throws IOException
Since
2.9
schemaLoaderback to summary
public ProtobufSchemaLoader schemaLoader()

Accessor for reusable ProtobufSchemaLoader which can be used for loading protoc definitions from files and other external sources.

setSchemaLoaderback to summary
public void setSchemaLoader(ProtobufSchemaLoader l)
versionback to summary
public Version version()

Overrides com.fasterxml.jackson.databind.ObjectMapper.version.

Implements com.fasterxml.jackson.core.Versioned.version.

Doc from com.fasterxml.jackson.databind.ObjectMapper.version.

Method that will return version information stored in and read from jar that contains this class.

Returns:Version

Doc from com.fasterxml.jackson.core.Versioned.version.

Version of the component

Annotations
@Override
com.fasterxml.jackson.dataformat.protobuf back to summary

public Class ProtobufMapper.Builder

extends MapperBuilder<ProtobufMapper, ProtobufMapper.Builder>
Class Inheritance

Base implementation for "Vanilla" ObjectMapper, used with Protobuf backend.
Since
2.10

Field Summary

Inherited from com.fasterxml.jackson.databind.cfg.MapperBuilder:
_mapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.fasterxml.jackson.databind.cfg.MapperBuilder:
_thisaccessorNamingactivateDefaultTypingactivateDefaultTypingactivateDefaultTypingactivateDefaultTypingAsPropertyaddHandleraddMixInaddModuleaddModulesaddModulesannotationIntrospectorbuildcacheProviderclearProblemHandlersconfigureconfigureconfigureconfigureconfigureconfigureconfigureconfigureconstructorDetectordeactivateDefaultTypingdefaultAttributesdefaultBase64VariantdefaultDateFormatdefaultLeniencydefaultLocaledefaultMergeabledefaultPrettyPrinterdefaultPropertyInclusiondefaultSetterInfodefaultTimeZonedisabledisabledisabledisabledisabledisabledisabledisableenableenableenableenableenableenableenableenablefilterProviderfindAndAddModulesfindModulesfindModuleshandlerInstantiatorinjectableValuesisEnabledisEnabledisEnabledisEnabledisEnablednodeFactorypolymorphicTypeValidatorpropertyNamingStrategyregisterSubtypesregisterSubtypesregisterSubtypesremoveMixInserializationInclusionserializerFactorysetDefaultTypingstreamFactorysubtypeResolvertypeFactoryvisibilityvisibilitywithCoercionConfigwithCoercionConfigwithCoercionConfigDefaultswithConfigOverride

Constructor Detail

Builderback to summary
public Builder(ProtobufMapper m)