|
||||||||||
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 java.lang.Class<?>[] |
EMPTY_CLASS_ARRAY
|
Method Summary | |
---|---|
static java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> |
asMethodGroupsByTypeName(java.lang.reflect.Method[] methods)
Return the methods as a map keyed by their common declaration types. |
static java.lang.String |
asShortestName(java.lang.Class<?> type)
Return the name of the type in its short form if its known to us otherwise return its name fully packaged. |
static java.util.Map<java.lang.Class<?>,java.lang.String> |
getClassShortNames()
|
static java.lang.Class<?> |
getPrimitiveTypeFor(java.lang.String name)
Returns the type(class) for the name specified or null if not found. |
static java.lang.Class<?> |
getTypeFor(java.lang.String shortName)
Attempt to determine the actual class given the short name. |
static java.lang.reflect.Method |
methodFor(java.lang.Class<?> clasz,
java.lang.String methodName,
java.lang.Class<?>[] paramTypes)
Attempts to return the specified method from the class provided but will walk up its superclasses until it finds a match. |
static java.lang.String |
withoutPackageName(java.lang.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 java.lang.Class<?>[] EMPTY_CLASS_ARRAY
Method Detail |
---|
public static java.lang.Class<?> getPrimitiveTypeFor(java.lang.String name)
name
- String
public static java.util.Map<java.lang.Class<?>,java.lang.String> getClassShortNames()
public static java.lang.Class<?> getTypeFor(java.lang.String shortName)
shortName
- String
public static java.lang.String asShortestName(java.lang.Class<?> type)
type
-
public static java.lang.String withoutPackageName(java.lang.String fullTypeName)
fullTypeName
-
public static java.lang.reflect.Method methodFor(java.lang.Class<?> clasz, java.lang.String methodName, java.lang.Class<?>[] paramTypes)
clasz
- ClassmethodName
- StringparamTypes
- Class[]
public static java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> asMethodGroupsByTypeName(java.lang.reflect.Method[] methods)
methods
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |