All Downloads are FREE. Search and download functionalities are using the official Maven repository.

chaschev.lang.reflect.ConstructorDesc Maven / Gradle / Ivy

There is a newer version: 1.4
Show newest version
package chaschev.lang.reflect;

import chaschev.util.Exceptions;

import java.lang.reflect.Constructor;

/**
* @author Andrey Chaschev [email protected]
*/
public class ConstructorDesc extends HavingMethodSignature {
    protected final Constructor constructor;

    public ConstructorDesc(Constructor constructor) {
        super(constructor.getParameterTypes());
        this.constructor = constructor;
        constructor.setAccessible(true);
    }

    public T newInstance(Object[] params) {
        try {
            return constructor.newInstance(params);
        } catch (Exception e) {
            throw Exceptions.runtime(e);
        }
    }

    @Override
    public String getName() {
        return "";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy