public final class ReflectionUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Class<?> |
getClassByName(String name)
Loads a class by name.
|
static <T> T |
newInstance(Class<T> klass,
Object... args)
Uses the constructor represented by this
Constructor object to create
and initialize a new instance of the constructor's declaring class, with the
specified initialization parameters. |
public static Class<?> getClassByName(String name) throws ClassNotFoundException
name
- the class name.ClassNotFoundException
- if the class is not found.public static <T> T newInstance(Class<T> klass, Object... args)
Constructor
object to create
and initialize a new instance of the constructor's declaring class, with the
specified initialization parameters.T
- type for the new instanceklass
- the Class object.args
- array of objects to be passed as arguments to the constructor
call.Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.