Interface ClassUtils
-
-
Method Summary
Static Methods Modifier and Type Method Description static java.lang.String
getClassName(javax.lang.model.type.TypeMirror type)
Returns the fully qualified name of the class represented by the givenTypeMirror
.static java.lang.Class
loadClass(java.lang.String className)
Loads the class represented by the given fully qualified class name.static java.lang.Class
loadClass(javax.lang.model.type.TypeMirror type)
Loads the class represented by the givenTypeMirror
.
-
-
-
Method Detail
-
getClassName
static java.lang.String getClassName(javax.lang.model.type.TypeMirror type)
Returns the fully qualified name of the class represented by the givenTypeMirror
.- Parameters:
type
- the type mirror to get the class name from- Returns:
- the fully qualified class name
-
loadClass
static java.lang.Class loadClass(javax.lang.model.type.TypeMirror type)
Loads the class represented by the givenTypeMirror
.This method attempts to resolve the class using the fully qualified name derived from the type mirror. If the class cannot be resolved directly, an attempt is made to resolve it as a nested or inner class by replacing the last dot (
.
) with a dollar sign ($
).- Parameters:
type
- the type mirror representing the class to load- Returns:
- the resolved
Class
, ornull
if the class cannot be found
-
loadClass
static java.lang.Class loadClass(java.lang.String className)
Loads the class represented by the given fully qualified class name.This method attempts to resolve the class using the provided class name and the class loader obtained from
ClassUtils
. If the class is not found, an attempt is made to resolve it as a nested or inner class by replacing the last dot (.
) with a dollar sign ($
).- Parameters:
className
- the fully qualified name of the class to load- Returns:
- the resolved
Class
, ornull
if the class cannot be found
-
-