Modifier and Type | Method and Description |
---|---|
static Class<?> |
classFromString(String className)
Attempts to find the specified class using the default class loader.
|
static Class<?> |
classFromString(String className,
ClassLoader classLoader)
Attempts to find the specified class using the specified
classLoader . |
static String |
classToString(Class<?> clazz)
Returns the full name of the specified type (including the array brackets
if it is an array class).
|
public static String classToString(Class<?> clazz)
clazz
- classpublic static Class<?> classFromString(String className) throws ClassNotFoundException
ClassNotFoundException
is thrown.className
- the full class nameClassNotFoundException
- if the class name could not be foundpublic static Class<?> classFromString(String className, ClassLoader classLoader) throws ClassNotFoundException
classLoader
. If the class loader is null
, then the
default class loader is used. The class name may contain square brackets
to indicate an array class. If the class can't be found, an
ClassNotFoundException
is thrown.className
- the full class nameclassLoader
- the class loader to use (or null
)ClassNotFoundException
- if the class name could not be foundCopyright © 2019 Speedment, Inc.. All rights reserved.