Top Description Fields Constructors Methods
tools.jackson.jakarta.rs.smile

public Class JacksonSmileProvider

extends ProviderBase<JacksonSmileProvider, SmileMapper, SmileEndpointConfig, SmileMapperConfigurator>
Class Inheritance
Known Direct Subclasses
tools.jackson.jakarta.rs.smile.JacksonXmlBindSmileProvider
Annotations
@Provider
@Consumes:*/*
@Produces:*/*
Imports
java.lang.annotation.Annotation, jakarta.ws.rs.Consumes, .Produces, jakarta.ws.rs.core.Context, .MediaType, jakarta.ws.rs.ext.ContextResolver, .Provider, .Providers, tools.jackson.core.Version, tools.jackson.databind.AnnotationIntrospector, .ObjectMapper, .ObjectReader, .ObjectWriter, tools.jackson.dataformat.smile.SmileMapper, tools.jackson.jakarta.rs.base.ProviderBase

Basic implementation of Jakarta-RS abstractions (MessageBodyReader,
Author
Tatu Saloranta

Field Summary

Modifier and TypeField and Description
protected Providers
_providers

Injectable context object used to locate configured instance of ObjectMapper to use for actual serialization.

Inherited from tools.jackson.jakarta.rs.base.ProviderBase:
_cfgCustomUntouchables_defaultReadView_defaultWriteView_jakartaRSFeatures_mapperConfig_readers_unreadableClasses_untouchables_unwritableClasses_writersDEFAULT_UNREADABLESDEFAULT_UNTOUCHABLESDEFAULT_UNWRITABLESHEADER_CONTENT_TYPE_OPTIONSJAKARTA_RS_FEATURE_DEFAULTS

Constructor Summary

AccessConstructor and Description
public
JacksonSmileProvider()

Default constructor, usually used when provider is automatically configured to be used with JAX-RS implementation.

public
public
JacksonSmileProvider(SmileMapper mapper, AnnotationIntrospector
AnnotationIntrospector to override default with, if any
aiOverride
)

Constructor to use when a custom mapper (usually components like serializer/deserializer factories that have been configured) is to be used.

Method Summary

Modifier and TypeMethod and Description
protected SmileEndpointConfig
protected SmileEndpointConfig
protected SmileMapper
_locateMapperViaProvider(Class<?>
Class of object being serialized or deserialized; not checked at this point, since it is assumed that unprocessable classes have been already weeded out, but will be passed to ContextResolver as is.
type
,
MediaType
Declared media type for the instance to process: not used by this method, but will be passed to ContextResolver as is.
mediaType
)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase._locateMapperViaProvider.

Method called to locate ObjectMapper to use for serialization and deserialization.

protected boolean
hasMatchingMediaType(MediaType mediaType)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase.hasMatchingMediaType.

Helper method used to check whether given media type is Smile type or sub type.

public Version
version()

Implements tools.jackson.core.Versioned.version.

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

Inherited from tools.jackson.jakarta.rs.base.ProviderBase:
_addSuperTypes_configForReading_configForWriting_containedIn_createGenerator_createNoContentException_createParser_endpointForReading_endpointForWriting_findCustomUntouchable_isIgnorableForReading_isIgnorableForWriting_isSpecialReadable_modifyHeadersaddUntouchableconfigureconfigureconfiguredisabledisabledisabledisableenableenableenableenablefindEncodingfindSuperTypesfindSuperTypesgetSizehasMatchingMediaTypeForReadinghasMatchingMediaTypeForWritingisEnabledisReadableisWriteablelocateMapperreadFromremoveUntouchablesetAnnotationsToUsesetDefaultReadViewsetDefaultViewsetDefaultWriteViewsetMapperwriteTo

Field Detail

_providersback to summary
protected Providers _providers

Injectable context object used to locate configured instance of ObjectMapper to use for actual serialization.

Annotations
@Context

Constructor Detail

JacksonSmileProviderback to summary
public JacksonSmileProvider()

Default constructor, usually used when provider is automatically configured to be used with JAX-RS implementation.

JacksonSmileProviderback to summary
public JacksonSmileProvider(SmileMapper mapper)
JacksonSmileProviderback to summary
public JacksonSmileProvider(SmileMapper mapper, AnnotationIntrospector aiOverride)

Constructor to use when a custom mapper (usually components like serializer/deserializer factories that have been configured) is to be used.

Parameters
aiOverride:AnnotationIntrospector

AnnotationIntrospector to override default with, if any

Method Detail

_configForReadingback to summary
protected SmileEndpointConfig _configForReading(ObjectReader reader, Annotation[] annotations)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase._configForReading.

Annotations
@Override
_configForWritingback to summary
protected SmileEndpointConfig _configForWriting(ObjectWriter writer, Annotation[] annotations)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase._configForWriting.

Annotations
@Override
_locateMapperViaProviderback to summary
protected SmileMapper _locateMapperViaProvider(Class<?> type, MediaType mediaType)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase._locateMapperViaProvider.

Method called to locate ObjectMapper to use for serialization and deserialization. If an instance has been explicitly defined by setMapper (or non-null instance passed in constructor), that will be used. If not, will try to locate it using standard JAX-RS ContextResolver mechanism, if it has been properly configured to access it (by JAX-RS runtime). Finally, if no mapper is found, will return a default unconfigured ObjectMapper instance (one constructed with default constructor and not modified in any way)

Parameters
type:Class<?>

Class of object being serialized or deserialized; not checked at this point, since it is assumed that unprocessable classes have been already weeded out, but will be passed to ContextResolver as is.

mediaType:MediaType

Declared media type for the instance to process: not used by this method, but will be passed to ContextResolver as is.

Annotations
@Override
hasMatchingMediaTypeback to summary
protected boolean hasMatchingMediaType(MediaType mediaType)

Implements abstract tools.jackson.jakarta.rs.base.ProviderBase.hasMatchingMediaType.

Helper method used to check whether given media type is Smile type or sub type. Current implementation essentially checks to see whether MediaType#getSubtype returns "smile" or something ending with "+smile".

Annotations
@Override
versionback to summary
public Version version()

Implements tools.jackson.core.Versioned.version.

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

Annotations
@Override