Package org.jdom2.internal
Class ReflectionConstructor
java.lang.Object
org.jdom2.internal.ReflectionConstructor
Utility class that handles constructing a class using reflection, and a
no-argument 'default' constructor.
- Author:
- Rolf Lear
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ReflectionConstructor
public ReflectionConstructor()
-
-
Method Details
-
construct
Construct a new instance of the named class, and ensure it is cast to the type specified as the targetclass.- Type Parameters:
E
- The generic type of the returned value.- Parameters:
classname
- The class name of the instance to create.targetclass
- The return type of the created instance- Returns:
- an instantiated class
- Throws:
IllegalArgumentException
- if there is a problem locating the class instance.IllegalStateException
- if there is a problem instantiating a class instance.
-