E - the type of the instances to createpublic class ReflectionSupplier<E> extends Object implements java.util.function.Supplier<E>
| Constructor and Description |
|---|
ReflectionSupplier(Class<? extends E> type)
Configures this
ReflectionSupplier to create instances by calling
the default Constructor on the given type The constructor must be
public and accessible, must belong to a non-abstract class and may not
throw checked Exceptions. |
ReflectionSupplier(Class<? extends E> type,
Class<?>[] argTypes,
java.util.function.Supplier<Object[]> argSupplier)
Configures this
ReflectionSupplier to create instances by calling
the Constructor identified by the given Class object and
list of constructor argument types on the given type taking the
constructor arguments from the given argument Supplier. |
ReflectionSupplier(Constructor<? extends E> constructor,
java.util.function.Supplier<Object[]> argSupplier)
Configures this
ReflectionSupplier to create instances by calling
the given Constructor taking the constructor arguments from the
given argument Supplier. |
public ReflectionSupplier(Constructor<? extends E> constructor, java.util.function.Supplier<Object[]> argSupplier) throws IllegalArgumentException, SecurityException
ReflectionSupplier to create instances by calling
the given Constructor taking the constructor arguments from the
given argument Supplier. The constructor must be public, must
belong to a non-abstract class and may not throw checked Exceptions.constructor - the Constructor to invoke to create new instancesargSupplier - the Supplier to invoke to get the constructor argumentsIllegalArgumentException - if the given Constructor is not public, throws any
checked Exception or belongs to an abstract classSecurityException - if the given Constructor cannot be set accessiblepublic ReflectionSupplier(Class<? extends E> type, Class<?>[] argTypes, java.util.function.Supplier<Object[]> argSupplier) throws IllegalArgumentException, SecurityException, NoSuchMethodException
ReflectionSupplier to create instances by calling
the Constructor identified by the given Class object and
list of constructor argument types on the given type taking the
constructor arguments from the given argument Supplier. The
constructor must be public, must belong to a non-abstract class and may
not throw checked Exceptions.type - the Class object identifying the type to generate
instances ofargTypes - an array of Class objects identifying the parameter
types of the constructor to find on the given typeargSupplier - the Supplier to invoke to get the constructor argumentsIllegalArgumentException - if the given Constructor is not public, throws any
checked Exception or belongs to an abstract classNoSuchMethodException - if there is no matching Constructor on the given classSecurityException - if access to the identified Constructor is secured via
SecurityManagerpublic ReflectionSupplier(Class<? extends E> type) throws IllegalArgumentException, SecurityException, NoSuchMethodException
ReflectionSupplier to create instances by calling
the default Constructor on the given type The constructor must be
public and accessible, must belong to a non-abstract class and may not
throw checked Exceptions.type - the Class object identifying the type to generate
instances ofIllegalArgumentException - if the default Constructor is not public, throws any
checked Exception or belongs to an abstract classNoSuchMethodException - if there is no default Constructor on the given classSecurityException - if access to the default Constructor is secured via
SecurityManagerpublic final E get()
get in interface java.util.function.Supplier<E>Copyright © 2017. All rights reserved.