public final class ClassUtil extends Object
Modifier and Type | Field and Description |
---|---|
static Class<?>[] |
EMPTY_CLASS_ARRAY |
Modifier and Type | Method and Description |
---|---|
static Map<String,List<Method>> |
asMethodGroupsByTypeName(Method[] methods)
Return the methods as a map keyed by their common declaration types.
|
static String |
asShortestName(Class<?> type)
Return the name of the type in its short form if its known to us
otherwise return its name fully packaged.
|
static Map<Class<?>,String> |
getClassShortNames() |
static Class<?> |
getPrimitiveTypeFor(String name)
Returns the type(class) for the name specified or null if not found.
|
static Class<?> |
getTypeFor(String shortName)
Attempt to determine the actual class given the short name.
|
static Method |
methodFor(Class<?> clasz,
String methodName,
Class<?>[] paramTypes)
Attempts to return the specified method from the class provided but will
walk up its superclasses until it finds a match.
|
static String |
withoutPackageName(String fullTypeName)
Returns the abbreviated name of the type, without the package name
|
public static final Class<?>[] EMPTY_CLASS_ARRAY
public static Class<?> getPrimitiveTypeFor(String name)
name
- Stringpublic static Class<?> getTypeFor(String shortName)
shortName
- Stringpublic static String asShortestName(Class<?> type)
type
- public static String withoutPackageName(String fullTypeName)
fullTypeName
- public static Method methodFor(Class<?> clasz, String methodName, Class<?>[] paramTypes)
clasz
- ClassmethodName
- StringparamTypes
- Class[]Copyright © 2002-2017 PMD. All Rights Reserved.