Example usage for java.lang.reflect Constructor getGenericExceptionTypes

List of usage examples for java.lang.reflect Constructor getGenericExceptionTypes

Introduction

In this page you can find the example usage for java.lang.reflect Constructor getGenericExceptionTypes.

Prototype

@Override
public Type[] getGenericExceptionTypes() 

Source Link

Usage

From source file:Main.java

public static void print_method_or_constructor(Member member) {
    Constructor c = (Constructor) member;
    Type[] types = c.getGenericExceptionTypes();
}

From source file:org.alfresco.module.org_alfresco_module_rm.api.PublicAPITestUtil.java

/**
 * Get all types referenced by the supplied constructor (i.e. the parameters and exceptions).
 *
 * @param constructor The constructor to analyse.
 * @return The set of types.//from  w w  w. ja v  a2s  . co  m
 */
private static Set<Type> getTypesFromConstructor(Constructor<?> constructor) {
    Set<Type> methodTypes = new HashSet<>();
    methodTypes.addAll(Sets.newHashSet(constructor.getGenericParameterTypes()));
    methodTypes.addAll(Sets.newHashSet(constructor.getGenericExceptionTypes()));
    return methodTypes;
}