public class BambooReflectionUtils extends Object
Constructor and Description |
---|
BambooReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Field> |
getAllDeclaredFields(Class<?> clazz)
Returns all fields declared in the supplied class and its superclasses.
|
static List<Method> |
getAllDeclaredMethods(Class<?> clazz)
Returns all methods declared in the supplied class and its superclasses.
|
static Class<?> |
getSimpleType(Class<?> aClass) |
static boolean |
hasCustomDeserialisation(Class<?> clazz)
Returns true if the class or any of its superclasses contain custom deserialisation method(s).
|
static <T> T |
instantiateQuietly(Class<T> aClass)
Instantiates a class quietly, throwing all possible exceptions as
RuntimeException . |
static String |
method2SignatureString(Method method)
Returns simplified signature of a method consisting of fully qualified class name, method name and list of argument types.
|
@NotNull public static <T> T instantiateQuietly(@NotNull Class<T> aClass)
RuntimeException
. Uses Class.newInstance()
method to instantiate class.T
- type of the object to be instantiatedaClass
- class to be instantiated.RuntimeException
- if any exceptions occurred while instantiating the class (e.g. InstantiationException
or IllegalAccessException
), RuntimeException
will be thrown as a wrapping exception.public static Class<?> getSimpleType(@NotNull Class<?> aClass)
aClass
- public static List<Field> getAllDeclaredFields(@NotNull Class<?> clazz)
public static List<Method> getAllDeclaredMethods(Class<?> clazz)
public static boolean hasCustomDeserialisation(Class<?> clazz)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.