|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jackson.map.util.ClassUtil
public final class ClassUtil
Constructor Summary | |
---|---|
ClassUtil()
|
Method Summary | ||
---|---|---|
static String |
canBeABeanType(Class<?> type)
|
|
static void |
checkAndFixAccess(Member member)
Method called to check if we can use the passed method or constructor (wrt access restriction -- public methods can be called, others usually not); and if not, if there is a work-around for the problem. |
|
static
|
createInstance(Class<T> cls,
boolean canFixAccess)
Method that can be called to try to create an instantiate of specified type. |
|
static List<Class<?>> |
findSuperTypes(Class<?> cls,
Class<?> endBefore)
Method that will find all sub-classes and implemented interfaces of a given class or interface. |
|
static Throwable |
getRootCause(Throwable t)
Method that can be used to find the "root cause", innermost of chained (wrapped) exceptions. |
|
static boolean |
hasGetterSignature(Method m)
|
|
static boolean |
isConcrete(Class<?> type)
Helper method that checks if given class is a concrete one; that is, not an interface or abstract class. |
|
static String |
isLocalType(Class<?> type)
|
|
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. |
|
static void |
throwAsIAE(Throwable t)
|
|
static void |
throwAsIAE(Throwable t,
String msg)
|
|
static void |
unwrapAndThrowAsIAE(Throwable t)
|
|
static void |
unwrapAndThrowAsIAE(Throwable t,
String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassUtil()
Method Detail |
---|
public static List<Class<?>> findSuperTypes(Class<?> cls, Class<?> endBefore)
Object.class
is not included in the list
regardless of whether endBefore
argument is defined
endBefore
- Super-type to NOT include in results, if any; when
encountered, will be ignored (and no super types are checked).public static String canBeABeanType(Class<?> type)
public static String isLocalType(Class<?> type)
public static boolean isProxyType(Class<?> type)
public static boolean isConcrete(Class<?> type)
public static boolean hasGetterSignature(Method m)
public static Throwable getRootCause(Throwable t)
public static void throwAsIAE(Throwable t)
public static void throwAsIAE(Throwable t, String msg)
public static void unwrapAndThrowAsIAE(Throwable t)
public static void unwrapAndThrowAsIAE(Throwable t, String msg)
public static <T> T createInstance(Class<T> cls, boolean canFixAccess) throws IllegalArgumentException
canFixAccess
- Whether it is possible to try to change access
rights of the default constructor (in case it is not publicly
accessible) or not.
IllegalArgumentException
- If instantiation fails for any reason;
except for cases where constructor throws an unchecked exception
(which will be passed as is)public static void checkAndFixAccess(Member member)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |