| Modifier and Type | Class and Description |
|---|---|
| public static class | ClassUtil.Ctor
Value class used for caching Constructor declarations; used because caching done by JDK appears to be somewhat inefficient for some use cases. |
| private static class | ClassUtil.EnumTypeLocator
Inner class used to contain gory details of how we can determine
details of instances of common JDK types like |
| Modifier and Type | Field and Description |
|---|---|
| private static final Class | |
| private static final Iterator | |
| private static final Annotation[] | |
| private static final ClassUtil. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static void | _addRawSuperTypes(Class<?> cls, Class<?> endBefore, Collection<Class<?>> result, boolean addClassItself)
|
| private static void | _addSuperTypes(JavaType type, Class<?> endBefore, Collection<JavaType> result, boolean addClassItself)
|
| private static Method[] | |
| private static Class | |
| public static String | |
| public static String | |
| public static String | Returns: Null if class might be a bean; type String (that identifies why it's not a bean) if not
|
| public static void | checkAndFixAccess(Member member)
Deprecated
Since 2.7 call variant that takes boolean flag.
Equivalent to call:
checkAndFixAccess(member, false); |
| public static void | checkAndFixAccess(Member
Accessor to call member, boolean setAccessible() on.Whether to always try to make accessor
accessible, even if evenIfAlreadyPublic)public (true),
or only if needed to force by-pass of non-public access (false)Method that is called if a |
| public static String | classNameOf(Object inst)
Helper method used to construct appropriate description when passed either type (Class) or an instance; in latter case, class of instance is to be used. |
| public static Class | |
| public static void | closeOnFailAndThrowAsIOE(JsonGenerator g, Exception fail)
Helper method that encapsulate logic in trying to close output generator in case of failure; useful mostly in forcing flush()ing as otherwise error conditions tend to be hard to diagnose. |
| public static void | closeOnFailAndThrowAsIOE(JsonGenerator g, Closeable toClose, Exception fail)
Helper method that encapsulate logic in trying to close given |
| public static <T> T | createInstance(Class<T> cls, boolean
Whether it is possible to try to change access
rights of the default constructor (in case it is not publicly
accessible) or not. canFixAccess)Method that can be called to try to create an instantiate of specified type. |
| public static Object | defaultValue(Class<?> cls)
Helper method used to get default value for wrappers used for primitive types (0 for Integer etc) |
| public static <T> Iterator | |
| public static String | exceptionMessage(Throwable t)
Helper method that returns |
| public static Annotation[] | |
| public static <T> Constructor | |
| public static Class | findEnumType(EnumSet<?> s)
Helper method that can be used to dynamically figure out
enumeration type of given |
| public static Class | findEnumType(EnumMap<?, ?> m)
Helper method that can be used to dynamically figure out
enumeration type of given |
| public static Class | findEnumType(Enum<?> en)
Helper method that can be used to dynamically figure out formal enumeration type (class) for given enumeration. |
| public static Class | findEnumType(Class<?> cls)
Helper method that can be used to dynamically figure out formal enumeration type (class) for given class of an enumeration value. |
| public static <T extends Annotation> Enum | Returns: the Enum value annotated with the given Annotation ornull if none is found.The Enum class to scan for a value with the given annotation enumClass, Class<T> The annotation to look for. annotationClass)A method that will look for the first Enum value annotated with the given Annotation. |
| public static List | |
| public static List | findSuperClasses(Class<?> cls, Class<?> endBefore, boolean addClassItself)
Method for finding all super classes (but not super interfaces) of given class, starting with the immediate super class and ending in the most distant one. |
| public static List | findSuperTypes(JavaType type, Class<?>
Super-type to NOT include in results, if any; when
encountered, will be ignored (and no super types are checked). endBefore, boolean addClassItself)Method that will find all sub-classes and implemented interfaces of a given class or interface. |
| public static List | |
| public static List | |
| public static String | getClassDescription(Object classOrInstance)
Helper method used to construct appropriate description when passed either type (Class) or an instance; in latter case, class of instance is to be used. |
| public static Method[] | getClassMethods(Class<?> cls)
Helper method that gets methods declared in given class; usually a simple thing, but sometimes (as per [databind#785]) more complicated, depending on classloader setup. |
| public static ClassUtil. | |
| public static Field[] | |
| public static Method[] | |
| public static Class | |
| public static Class | |
| public static Type[] | |
| public static Type | |
| public static int | |
| public static Class | |
| public static String | |
| public static Throwable | getRootCause(Throwable t)
Method that can be used to find the "root cause", innermost of chained (wrapped) exceptions. |
| public static String | Returns: String description of type including generic type parameters, surrounded by backticks, if type passed; or string "null" if {code null} passedFully resolved type or null fullType)Helper method to create and return "backticked" description of given
resolved type (or, |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| public static boolean | isConcrete(Class<?> type)
Helper method that checks if given class is a concrete one; that is, not an interface or abstract class. |
| public static boolean | |
| public static boolean | isEnumType(Class<?> rawType)
Helper method that encapsulates reliable check on whether
given raw type "is an Enum", that is, is or extends |
| public static boolean | isJacksonStdImpl(Object impl)
Method that can be called to determine if given Object is the default implementation Jackson uses; as opposed to a custom serializer installed by a module or calling application. |
| public static boolean | |
| public static boolean | Returns: True if we can determine that the code is running on
JDK 17 or above; false otherwise.Convenience method for: return getJDKMajorVersion() >= 17 |
| public static boolean | isJDKClass(Class<?> rawType)
Accessor for checking whether given |
| public static String | |
| public static boolean | |
| public static boolean | |
| public static boolean | isProxyType(Class<?> type)
Helper method used to weed out dynamic Proxy types; types that do not expose concrete method API that we could use to figure out automatic Bean (property) based serialization. |
| public static boolean | |
| public static String | |
| public static String | name(PropertyName name)
Returns either single-quoted (apostrophe) |
| public static String | |
| public static String | |
| public static <T> T | |
| public static String | |
| public static String | |
| public static Class | primitiveType(Class<?> type)
Method that can be used to find primitive type for given class if (but only if)
it is either wrapper type or primitive type; returns |
| public static String | |
| public static Class | |
| public static void | throwAsIAE(Throwable t)
Method that will wrap 't' as an |
| public static void | throwAsIAE(Throwable t, String msg)
Method that will wrap 't' as an |
| public static <T> T | |
| public static Throwable | throwIfError(Throwable t)
Helper method that will check if argument is an |
| public static Throwable | throwIfIOE(Throwable t)
Helper method that will check if argument is an |
| public static Throwable | throwIfRTE(Throwable t)
Helper method that will check if argument is an |
| public static Throwable | throwRootCauseIfIOE(Throwable t)
Method that works like by calling |
| public static void | unwrapAndThrowAsIAE(Throwable t)
Method that will locate the innermost exception for given Throwable;
and then wrap it as an |
| public static void | unwrapAndThrowAsIAE(Throwable t, String msg)
Method that will locate the innermost exception for given Throwable;
and then wrap it as an |
| public static void | |
| public static Class | wrapperType(Class<?> primitiveType)
Helper method for finding wrapper type for given primitive type (why isn't there one in JDK?). |