Top Description Fields Constructors Methods
com.fasterxml.jackson.module.paramnames

public Class ParameterNamesAnnotationIntrospector

extends NopAnnotationIntrospector
Class Inheritance
Imports
java.lang.reflect.MalformedParametersException, .Parameter, com.fasterxml.jackson.annotation.JsonCreator, com.fasterxml.jackson.databind.AnnotationIntrospector, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.*

Introspector that uses parameter name information provided by the Java Reflection API additions in Java 8 to determine the parameter name for methods and constructors.
Author
Lovro Pandzic
See Also
AnnotationIntrospector, Parameter

Field Summary

Modifier and TypeField and Description
private final JsonCreator.Mode
private final ParameterExtractor
private static final long
Inherited from com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector:
instance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public JsonCreator.Mode
findCreatorAnnotation(MapperConfig<?>
Configuration settings in effect (for serialization or deserialization)
config
,
Annotated
Annotated accessor (usually constructor or static method) to check
a
)

Overrides com.fasterxml.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Method called to check whether potential Creator (constructor or static factory method) has explicit annotation to indicate it as actual Creator; and if so, which com.fasterxml.jackson.annotation.JsonCreator.Mode to use.

public String
findImplicitPropertyName(AnnotatedMember m)

Overrides com.fasterxml.jackson.databind.AnnotationIntrospector.findImplicitPropertyName.

Method for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent.

private String
private Parameter[]
Inherited from com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector:
version

Field Detail

creatorBindingback to summary
private final JsonCreator.Mode creatorBinding
parameterExtractorback to summary
private final ParameterExtractor parameterExtractor
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector.serialVersionUID.

Constructor Detail

ParameterNamesAnnotationIntrospectorback to summary
pack-priv ParameterNamesAnnotationIntrospector(JsonCreator.Mode creatorBinding, ParameterExtractor parameterExtractor)

Method Detail

findCreatorAnnotationback to summary
public JsonCreator.Mode findCreatorAnnotation(MapperConfig<?> config, Annotated a)

Overrides com.fasterxml.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Doc from com.fasterxml.jackson.databind.AnnotationIntrospector.findCreatorAnnotation.

Method called to check whether potential Creator (constructor or static factory method) has explicit annotation to indicate it as actual Creator; and if so, which com.fasterxml.jackson.annotation.JsonCreator.Mode to use.

Note

caller needs to consider possibility of both `null` (no annotation found) and com.fasterxml.jackson.annotation.JsonCreator.Mode#DISABLED (annotation found, but disabled); latter is necessary as marker in case multiple introspectors are chained, as well as possibly as when using mix-in annotations.

Parameters
config:MapperConfig<?>

Configuration settings in effect (for serialization or deserialization)

a:Annotated

Annotated accessor (usually constructor or static method) to check

Returns:JsonCreator.Mode

Creator mode found, if any; null if none

Annotations
@Override
findImplicitPropertyNameback to summary
public String findImplicitPropertyName(AnnotatedMember m)

Overrides com.fasterxml.jackson.databind.AnnotationIntrospector.findImplicitPropertyName.

Doc from com.fasterxml.jackson.databind.AnnotationIntrospector.findImplicitPropertyName.

Method for finding implicit name for a property that given annotated member (field, method, creator parameter) may represent. This is different from explicit, annotation-based property name, in that it is "weak" and does not either proof that a property exists (for example, if visibility is not high enough), or override explicit names. In practice this method is used to introspect optional names for creator parameters (which may or may not be available and cannot be detected by standard databind); or to provide alternate name mangling for fields, getters and/or setters.

Annotations
@Override
findParameterNameback to summary
private String findParameterName(AnnotatedParameter annotatedParameter)
getParametersback to summary
private Parameter[] getParameters(AnnotatedWithParams owner)