Java Reflection Constructor Get getConstructor(String className, Class... argClasses)

Here you can find the source of getConstructor(String className, Class... argClasses)

Description

get Constructor

License

Open Source License

Declaration

@SuppressWarnings("unchecked")
    public static <T> Constructor<? extends T> getConstructor(String className, Class<?>... argClasses)
            throws ReflectiveOperationException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.lang.reflect.Constructor;

public class Main {
    @SuppressWarnings("unchecked")
    public static <T> Constructor<? extends T> getConstructor(String className, Class<?>... argClasses)
            throws ReflectiveOperationException {
        return ((Class<? extends T>) Class.forName(className)).getConstructor(argClasses);
    }/*from  w  w w .j a  v  a2  s  .c o m*/
}

Related

  1. getConstructor(final Class clazz, final Class... parametertypes)
  2. getConstructor(final Class clazz, final Class... parameterTypes)
  3. getConstructor(final Class clazz, final Object... constructorArgs)
  4. getConstructor(final Class clazz, final Object... objs)
  5. getConstructor(final Class instantiableClass, final Class... classes)
  6. getConstructor(String cls_name, Class[] param_cls)
  7. getConstructor(String string, Class... types)
  8. getConstructor(String type, Class[] paramTypes)
  9. getConstructor(String typeString)