Package net.sourceforge.pmd.util
Class ClassUtil
- java.lang.Object
-
- net.sourceforge.pmd.util.ClassUtil
-
@Deprecated public final class ClassUtil extends Object
Deprecated.Is internal APIVarious 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.- Author:
- Brian Remedios
-
-
Field Summary
Fields Modifier and Type Field Description static Class<?>[]
EMPTY_CLASS_ARRAY
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Map<String,List<Method>>
asMethodGroupsByTypeName(Method[] methods)
Deprecated.Return the methods as a map keyed by their common declaration types.static Map<String,List<Method>>
asMethodGroupsByTypeName(List<Method> methods)
Deprecated.Return the methods as a map keyed by their common declaration types.static String
asShortestName(Class<?> type)
Deprecated.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()
Deprecated.static Class<?>
getPrimitiveTypeFor(String name)
Deprecated.Returns the type(class) for the name specified or null if not found.static Class<?>
getTypeFor(String shortName)
Deprecated.Attempt to determine the actual class given the short name.static Method
methodFor(Class<?> clasz, String methodName, Class<?>[] paramTypes)
Deprecated.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)
Deprecated.Returns the abbreviated name of the type, without the package name
-
-
-
Field Detail
-
EMPTY_CLASS_ARRAY
public static final Class<?>[] EMPTY_CLASS_ARRAY
Deprecated.
-
-
Method Detail
-
getPrimitiveTypeFor
public static Class<?> getPrimitiveTypeFor(String name)
Deprecated.Returns the type(class) for the name specified or null if not found.- Parameters:
name
- String- Returns:
- Class
-
getTypeFor
public static Class<?> getTypeFor(String shortName)
Deprecated.Attempt to determine the actual class given the short name.- Parameters:
shortName
- String- Returns:
- Class
-
asShortestName
public static String asShortestName(Class<?> type)
Deprecated.Return the name of the type in its short form if its known to us otherwise return its name fully packaged.- Parameters:
type
-- Returns:
- String
-
withoutPackageName
public static String withoutPackageName(String fullTypeName)
Deprecated.Returns the abbreviated name of the type, without the package name- Parameters:
fullTypeName
-- Returns:
- String
-
methodFor
public static Method methodFor(Class<?> clasz, String methodName, Class<?>[] paramTypes)
Deprecated.Attempts to return the specified method from the class provided but will walk up its superclasses until it finds a match. Returns null if it doesn't.- Parameters:
clasz
- ClassmethodName
- StringparamTypes
- Class[]- Returns:
- Method
-
asMethodGroupsByTypeName
public static Map<String,List<Method>> asMethodGroupsByTypeName(Method[] methods)
Deprecated.Return the methods as a map keyed by their common declaration types.- Parameters:
methods
-- Returns:
- methods grouped by declaring type name
-
-