public final class DeprecationUtil extends Object
Deprecated
and MgnlDeprecated
annotations.Modifier and Type | Method and Description |
---|---|
static Optional<Class<?>> |
findFirstEncounteredDeprecatedSuperType(Class<?> clazz)
Searches for
Deprecated super types of the given clazz . |
static Collection<Method> |
getDeprecatedReadMethods(TypeMapping mapping,
Class<?> parentClass,
String sourcePropertyName)
Returns
Deprecated methods from parentClass . |
static String |
getDeprecationMessage(Class<?> deprecatedClass)
Returns human readable deprecation information for given
deprecatedClass . |
static String |
getDeprecationMessage(Class<?> actualClass,
Class<?> deprecatedParentClass)
Returns human readable deprecation information for given
actualClass and deprecatedParentClass . |
static String |
getDeprecationMessage(Method deprecatedMethod)
Returns human readable deprecation information for given
deprecatedMethod . |
static String |
getDeprecationMessage(String deprecatedType,
String deprecatedTypeName,
String since,
String description)
Returns human readable deprecation information.
|
static boolean |
isDeprecated(AnnotatedElement element)
Checks whether the given parameter
element is Deprecated or not. |
public static boolean isDeprecated(AnnotatedElement element)
element
is Deprecated or not.public static Optional<Class<?>> findFirstEncounteredDeprecatedSuperType(Class<?> clazz)
Deprecated
super types of the given clazz
.
Returns the first encountered Deprecated Interface or Class (in favour of Interface).
Returns Optional.EMPTY
, if nothing found.
public static Collection<Method> getDeprecatedReadMethods(TypeMapping mapping, Class<?> parentClass, String sourcePropertyName)
Deprecated
methods from parentClass
.
Internally fetches class hierarchy of the given parentClass
and iterates over them to find
all deprecated methods. This is done because those methods could be deprecated in the super class/interface,
however, not in the direct parentClass
.
public static String getDeprecationMessage(Class<?> deprecatedClass)
deprecatedClass
.public static String getDeprecationMessage(Class<?> actualClass, Class<?> deprecatedParentClass)
actualClass
and deprecatedParentClass
.public static String getDeprecationMessage(Method deprecatedMethod)
deprecatedMethod
.Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.