|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.pmd.util.ClassUtil
public final class ClassUtil
Various class-related utility methods intended for mapping common java.lang types to their short short forms allowing end users to enter these names in UIs without the package prefixes.
| Field Summary | |
|---|---|
static Class<?>[] |
EMPTY_CLASS_ARRAY
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Class<?>[] EMPTY_CLASS_ARRAY
| Method Detail |
|---|
public static Class<?> getPrimitiveTypeFor(String name)
name - String
public static Map<Class<?>,String> getClassShortNames()
public static Class<?> getTypeFor(String shortName)
shortName - String
public 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[]
public static Map<String,List<Method>> asMethodGroupsByTypeName(Method[] methods)
methods -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||