public class Classes extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
forNameOptional(String className)
Returns the class for the given name.
|
static Class<?> |
forNameUnchecked(String className)
Returns the class for the given name.
|
static Object |
newInstanceNonAccessibleOptional(Class<?> c)
Return a new instance of the given class.
|
static Object |
newInstanceNonAccessibleOptional(String className)
Return a new instance of the type described by the given class name.
|
static Object |
newInstanceNonAccessibleUnchecked(Class<?> c)
Return a new instance of the given class.
|
static Object |
newInstanceNonAccessibleUnchecked(String className)
Return a new instance of the type described by the given class name.
|
static Object |
newInstanceOptional(Class<?> c)
Return a new instance of the given class.
|
static Object |
newInstanceOptional(String className)
Return a new instance of the type described by the given class name.
|
static Object |
newInstanceUnchecked(Class<?> c)
Return a new instance of the given class.
|
static Object |
newInstanceUnchecked(String className)
Return a new instance of the type described by the given class name.
|
public static Class<?> forNameUnchecked(String className)
ReflectionExceptionclassName - The class nameReflectionException - If the type for the given name
can not be foundpublic static Class<?> forNameOptional(String className)
null if the underlying call did not succeed.className - The class namenull if
no such class could be foundpublic static Object newInstanceUnchecked(String className)
ReflectionExceptionclassName - The fully qualified class nameReflectionException - If the type for the given name
can not be found or not be instantiated.public static Object newInstanceOptional(String className)
null if the underlying call did not succeed.className - The fully qualified class namepublic static Object newInstanceUnchecked(Class<?> c)
ReflectionExceptionc - The classReflectionException - If the instance could not be created,
for example, because it is an abstract class or interface, or
has no public default constructorpublic static Object newInstanceOptional(Class<?> c)
null if the underlying call did not succeed.c - The classpublic static Object newInstanceNonAccessibleUnchecked(String className)
ReflectionExceptionclassName - The fully qualified class nameReflectionException - If the type for the given name
can not be found or not be instantiated.public static Object newInstanceNonAccessibleOptional(String className)
null if the underlying call did not succeed.className - The fully qualified class namepublic static Object newInstanceNonAccessibleUnchecked(Class<?> c)
ReflectionExceptionc - The classReflectionException - If the instance could not be created,
for example, because it is an abstract class or interface, or
has no parameterless constructorpublic static Object newInstanceNonAccessibleOptional(Class<?> c)
null if the underlying call did not succeed.c - The classCopyright © 2018. All rights reserved.