Skip to content

Commit

Permalink
Remove deprecated methods from AnnotationIntrospector (2.8 and earlier)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Apr 6, 2023
1 parent b868196 commit 7161d21
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -932,42 +932,6 @@ public JsonInclude.Value findPropertyInclusion(Annotated a) {
return JsonInclude.Value.empty();
}

/**
* Method for checking whether given annotated entity (class, method,
* field) defines which Bean/Map properties are to be included in
* serialization.
* If no annotation is found, method should return given second
* argument; otherwise value indicated by the annotation.
*<p>
* Note that meaning of inclusion value depends on whether it is for
* a Class or property (field/method/constructor): in former case,
* it is the default for all properties; in latter case it is specific
* override for annotated property.
*
* @return Enumerated value indicating which properties to include
* in serialization
*
* @deprecated Since 2.7 Use {@link #findPropertyInclusion} instead
*/
@Deprecated // since 2.7
public JsonInclude.Include findSerializationInclusion(Annotated a, JsonInclude.Include defValue) {
return defValue;
}

/**
* Method for checking whether content (entries) of a {@link java.util.Map} property
* are to be included during serialization or not.
* NOTE: this is NOT called for POJO properties, or array/Collection elements.
*
* @since 2.5
*
* @deprecated Since 2.7 Use {@link #findPropertyInclusion} instead
*/
@Deprecated // since 2.7
public JsonInclude.Include findSerializationInclusionForContent(Annotated a, JsonInclude.Include defValue) {
return defValue;
}

/*
/**********************************************************
/* Serialization: type refinements
Expand All @@ -987,30 +951,6 @@ public JavaType refineSerializationType(final MapperConfig<?> config,
return baseType;
}

/**
* @deprecated Since 2.7 call {@link #refineSerializationType} instead
*/
@Deprecated // since 2.7
public Class<?> findSerializationType(Annotated a) {
return null;
}

/**
* @deprecated Since 2.7 call {@link #refineSerializationType} instead
*/
@Deprecated // since 2.7
public Class<?> findSerializationKeyType(Annotated am, JavaType baseType) {
return null;
}

/**
* @deprecated Since 2.7 call {@link #refineSerializationType} instead
*/
@Deprecated // since 2.7
public Class<?> findSerializationContentType(Annotated am, JavaType baseType) {
return null;
}

/*
/**********************************************************
/* Serialization: class annotations
Expand Down Expand Up @@ -1327,62 +1267,6 @@ public JavaType refineDeserializationType(final MapperConfig<?> config,
return baseType;
}

/**
* Method for accessing annotated type definition that a
* property can have, to be used as the type for deserialization
* instead of the static (declared) type.
* Type is usually narrowing conversion (i.e.subtype of declared type).
* Declared return type of the method is also considered acceptable.
*
* @param ann Annotated entity to introspect
* @param baseType Assumed type before considering annotations
*
* @return Class to use for deserialization instead of declared type
*
* @deprecated Since 2.7 call {@link #refineDeserializationType} instead
*/
@Deprecated
public Class<?> findDeserializationType(Annotated ann, JavaType baseType) {
return null;
}

/**
* Method for accessing additional narrowing type definition that a
* method can have, to define more specific key type to use.
* It should be only be used with {@link java.util.Map} types.
*
* @param ann Annotated entity to introspect
* @param baseKeyType Assumed key type before considering annotations
*
* @return Class specifying more specific type to use instead of
* declared type, if annotation found; null if not
*
* @deprecated Since 2.7 call {@link #refineDeserializationType} instead
*/
@Deprecated
public Class<?> findDeserializationKeyType(Annotated ann, JavaType baseKeyType) {
return null;
}

/**
* Method for accessing additional narrowing type definition that a
* method can have, to define more specific content type to use;
* content refers to Map values and Collection/array elements.
* It should be only be used with Map, Collection and array types.
*
* @param ann Annotated entity to introspect
* @param baseContentType Assumed content (value) type before considering annotations
*
* @return Class specifying more specific type to use instead of
* declared type, if annotation found; null if not
*
* @deprecated Since 2.7 call {@link #refineDeserializationType} instead
*/
@Deprecated
public Class<?> findDeserializationContentType(Annotated ann, JavaType baseContentType) {
return null;
}

/*
/**********************************************************
/* Deserialization: class annotations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
* longer chains of introspectors by linking multiple pairs.
* Currently most likely combination is that of using the default
* Jackson provider, along with JAXB annotation introspector.
*<p>
* Note: up until 2.0, this class was an inner class of
* {@link AnnotationIntrospector}; moved here for convenience.
*
* @since 2.1
*/
Expand Down Expand Up @@ -379,27 +376,6 @@ public Object findNullSerializer(Annotated a) {
JsonSerializer.None.class);
}

@Deprecated
@Override
public JsonInclude.Include findSerializationInclusion(Annotated a,
JsonInclude.Include defValue)
{
// note: call secondary first, to give lower priority
defValue = _secondary.findSerializationInclusion(a, defValue);
defValue = _primary.findSerializationInclusion(a, defValue);
return defValue;
}

@Deprecated
@Override
public JsonInclude.Include findSerializationInclusionForContent(Annotated a, JsonInclude.Include defValue)
{
// note: call secondary first, to give lower priority
defValue = _secondary.findSerializationInclusionForContent(a, defValue);
defValue = _primary.findSerializationInclusionForContent(a, defValue);
return defValue;
}

@Override
public JsonInclude.Value findPropertyInclusion(Annotated a)
{
Expand Down Expand Up @@ -562,27 +538,6 @@ public JavaType refineSerializationType(MapperConfig<?> config,
return _primary.refineSerializationType(config, a, t);
}

@Override
@Deprecated
public Class<?> findSerializationType(Annotated a) {
Class<?> r = _primary.findSerializationType(a);
return (r == null) ? _secondary.findSerializationType(a) : r;
}

@Override
@Deprecated
public Class<?> findSerializationKeyType(Annotated am, JavaType baseType) {
Class<?> r = _primary.findSerializationKeyType(am, baseType);
return (r == null) ? _secondary.findSerializationKeyType(am, baseType) : r;
}

@Override
@Deprecated
public Class<?> findSerializationContentType(Annotated am, JavaType baseType) {
Class<?> r = _primary.findSerializationContentType(am, baseType);
return (r == null) ? _secondary.findSerializationContentType(am, baseType) : r;
}

// // // Serialization: class annotations

@Override
Expand Down Expand Up @@ -745,27 +700,6 @@ public JavaType refineDeserializationType(MapperConfig<?> config,
return _primary.refineDeserializationType(config, a, t);
}

@Override
@Deprecated
public Class<?> findDeserializationType(Annotated am, JavaType baseType) {
Class<?> r = _primary.findDeserializationType(am, baseType);
return (r != null) ? r : _secondary.findDeserializationType(am, baseType);
}

@Override
@Deprecated
public Class<?> findDeserializationKeyType(Annotated am, JavaType baseKeyType) {
Class<?> result = _primary.findDeserializationKeyType(am, baseKeyType);
return (result == null) ? _secondary.findDeserializationKeyType(am, baseKeyType) : result;
}

@Override
@Deprecated
public Class<?> findDeserializationContentType(Annotated am, JavaType baseContentType) {
Class<?> result = _primary.findDeserializationContentType(am, baseContentType);
return (result == null) ? _secondary.findDeserializationContentType(am, baseContentType) : result;
}

// // // Deserialization: class annotations

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -967,24 +967,6 @@ public JavaType refineSerializationType(final MapperConfig<?> config,
return type;
}

@Override
@Deprecated // since 2.7
public Class<?> findSerializationType(Annotated am) {
return null;
}

@Override
@Deprecated // since 2.7
public Class<?> findSerializationKeyType(Annotated am, JavaType baseType) {
return null;
}

@Override
@Deprecated // since 2.7
public Class<?> findSerializationContentType(Annotated am, JavaType baseType) {
return null;
}

/*
/**********************************************************
/* Serialization: class annotations
Expand Down Expand Up @@ -1303,24 +1285,6 @@ public JavaType refineDeserializationType(final MapperConfig<?> config,
return type;
}

@Override
@Deprecated // since 2.7
public Class<?> findDeserializationContentType(Annotated am, JavaType baseContentType) {
return null;
}

@Override
@Deprecated // since 2.7
public Class<?> findDeserializationType(Annotated am, JavaType baseType) {
return null;
}

@Override
@Deprecated // since 2.7
public Class<?> findDeserializationKeyType(Annotated am, JavaType baseKeyType) {
return null;
}

/*
/**********************************************************
/* Deserialization: Class annotations
Expand Down

0 comments on commit 7161d21

Please sign in to comment.