Example usage for org.aspectj.lang.reflect ConstructorSignature getExceptionTypes

List of usage examples for org.aspectj.lang.reflect ConstructorSignature getExceptionTypes

Introduction

In this page you can find the example usage for org.aspectj.lang.reflect ConstructorSignature getExceptionTypes.

Prototype

Class[] getExceptionTypes();

Source Link

Usage

From source file:se.crisp.codekvast.agent.lib.util.SignatureUtils.java

License:Open Source License

/**
 * Converts a java.lang.reflect.Constructor to a MethodSignature object.
 *
 * @param clazz       The class containing the method.
 * @param constructor The constructor to make a signature of.
 * @return A MethodSignature or null if the methodFilter stops the constructor.
 * @see #makeSignature(Class, Method)//from   w  w w .  jav a  2s .  c om
 */
public static MethodSignature makeConstructorSignature(Class<?> clazz, Constructor constructor) {
    org.aspectj.lang.reflect.ConstructorSignature aspectjSignature = (org.aspectj.lang.reflect.ConstructorSignature) makeSignature(
            clazz, constructor);

    if (aspectjSignature == null) {
        return null;
    }

    return MethodSignature.builder().aspectjString(signatureToString(aspectjSignature, true))
            .declaringType(aspectjSignature.getDeclaringTypeName())
            .exceptionTypes(classArrayToString(aspectjSignature.getExceptionTypes()))
            .methodName(aspectjSignature.getName())
            .modifiers(Modifier.toString(aspectjSignature.getModifiers()))
            .packageName(aspectjSignature.getDeclaringType().getPackage().getName())
            .parameterTypes(classArrayToString(aspectjSignature.getParameterTypes())).returnType("").build();

}