/** * Returns the resolved generic parameter types of {@code methodOrConstructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getParameterTypes(Member methodOrConstructor) { Type[] genericParameterTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericParameterTypes = method.getGenericParameterTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor constructor = (Constructor) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericParameterTypes = constructor.getGenericParameterTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericParameterTypes); }
/** * Returns the resolved generic exception types thrown by {@code constructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getExceptionTypes(Member methodOrConstructor) { Type[] genericExceptionTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericExceptionTypes = method.getGenericExceptionTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor<?> constructor = (Constructor<?>) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericExceptionTypes = constructor.getGenericExceptionTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericExceptionTypes); }
/** * Returns the resolved generic parameter types of {@code methodOrConstructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getParameterTypes(Member methodOrConstructor) { Type[] genericParameterTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericParameterTypes = method.getGenericParameterTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor constructor = (Constructor) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericParameterTypes = constructor.getGenericParameterTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericParameterTypes); }
/** * Returns the resolved generic parameter types of {@code methodOrConstructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getParameterTypes(Member methodOrConstructor) { Type[] genericParameterTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericParameterTypes = method.getGenericParameterTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor constructor = (Constructor) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericParameterTypes = constructor.getGenericParameterTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericParameterTypes); }
/** * Returns the resolved generic parameter types of {@code methodOrConstructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getParameterTypes(Member methodOrConstructor) { Type[] genericParameterTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericParameterTypes = method.getGenericParameterTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor constructor = (Constructor) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericParameterTypes = constructor.getGenericParameterTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericParameterTypes); }
/** * Returns the resolved generic exception types thrown by {@code constructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getExceptionTypes(Member methodOrConstructor) { Type[] genericExceptionTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericExceptionTypes = method.getGenericExceptionTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor<?> constructor = (Constructor<?>) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericExceptionTypes = constructor.getGenericExceptionTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericExceptionTypes); }
/** * Returns the resolved generic parameter types of {@code methodOrConstructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getParameterTypes(Member methodOrConstructor) { Type[] genericParameterTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; checkArgument(method.getDeclaringClass().isAssignableFrom(rawType), "%s is not defined by a supertype of %s", method, type); genericParameterTypes = method.getGenericParameterTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor constructor = (Constructor) methodOrConstructor; checkArgument(constructor.getDeclaringClass().isAssignableFrom(rawType), "%s does not construct a supertype of %s", constructor, type); genericParameterTypes = constructor.getGenericParameterTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericParameterTypes); }
/** * Returns the resolved generic exception types thrown by {@code constructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getExceptionTypes(Member methodOrConstructor) { Type[] genericExceptionTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericExceptionTypes = method.getGenericExceptionTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor<?> constructor = (Constructor<?>) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericExceptionTypes = constructor.getGenericExceptionTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericExceptionTypes); }
/** * Returns the resolved generic exception types thrown by {@code constructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getExceptionTypes(Member methodOrConstructor) { Type[] genericExceptionTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; if (!method.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(method + " is not defined by a supertype of " + type); } genericExceptionTypes = method.getGenericExceptionTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor<?> constructor = (Constructor<?>) methodOrConstructor; if (!constructor.getDeclaringClass().isAssignableFrom(rawType)) { throw new IllegalArgumentException(constructor + " does not construct a supertype of " + type); } genericExceptionTypes = constructor.getGenericExceptionTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericExceptionTypes); }
/** * Returns the resolved generic exception types thrown by {@code constructor}. * * @param methodOrConstructor a method or constructor defined by this or any supertype. * @since 2.0 */ public List<TypeLiteral<?>> getExceptionTypes(Member methodOrConstructor) { Type[] genericExceptionTypes; if (methodOrConstructor instanceof Method) { Method method = (Method) methodOrConstructor; checkArgument(method.getDeclaringClass().isAssignableFrom(rawType), "%s is not defined by a supertype of %s", method, type); genericExceptionTypes = method.getGenericExceptionTypes(); } else if (methodOrConstructor instanceof Constructor) { Constructor<?> constructor = (Constructor<?>) methodOrConstructor; checkArgument(constructor.getDeclaringClass().isAssignableFrom(rawType), "%s does not construct a supertype of %s", constructor, type); genericExceptionTypes = constructor.getGenericExceptionTypes(); } else { throw new IllegalArgumentException("Not a method or a constructor: " + methodOrConstructor); } return resolveAll(genericExceptionTypes); }