Java Reflection Constructor Get getConstructor(String cls_name, Class[] param_cls)

Here you can find the source of getConstructor(String cls_name, Class[] param_cls)

Description

get Constructor

License

Open Source License

Declaration

public static Constructor<?> getConstructor(String cls_name,
            Class<?>[] param_cls) 

Method Source Code

//package com.java2s;
import java.lang.reflect.Constructor;

public class Main {
    public static Constructor<?> getConstructor(String cls_name,
            Class<?>[] param_cls) {
        try {//from w  w w.  j a v a2  s .  com
            Class<?> c = Class.forName(cls_name);
            return c.getConstructor(param_cls);
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. getConstructor(final Class clazz, final Class... parameterTypes)
  2. getConstructor(final Class clazz, final Object... constructorArgs)
  3. getConstructor(final Class clazz, final Object... objs)
  4. getConstructor(final Class instantiableClass, final Class... classes)
  5. getConstructor(String className, Class... argClasses)
  6. getConstructor(String string, Class... types)
  7. getConstructor(String type, Class[] paramTypes)
  8. getConstructor(String typeString)
  9. getConstructorAccessor(Class enumClass, Class[] additionalParameterTypes)