public final class ClassUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Class<?>[] |
EMPTY_CLASS_ARRAY |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> |
asMethodGroupsByTypeName(java.util.List<java.lang.reflect.Method> methods)
Return the methods as a map keyed by their common declaration types.
|
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
|
public static java.lang.Class<?> getPrimitiveTypeFor(java.lang.String name)
name
- Stringpublic static java.util.Map<java.lang.Class<?>,java.lang.String> getClassShortNames()
public static java.lang.Class<?> getTypeFor(java.lang.String shortName)
shortName
- Stringpublic 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
- public static java.util.Map<java.lang.String,java.util.List<java.lang.reflect.Method>> asMethodGroupsByTypeName(java.util.List<java.lang.reflect.Method> methods)
methods
- Copyright © 2002–2017 PMD. All rights reserved.