public List<ResolvedConstructorDeclaration> getConstructors() { return Arrays.stream(clazz.getDeclaredConstructors()) .map(m -> new ReflectionConstructorDeclaration(m, typeSolver)) .collect(Collectors.toList()); }
@Override public ResolvedParameterDeclaration getParam(int i) { if (i < 0 || i >= getNumberOfParams()) { throw new IllegalArgumentException(String.format("No param with index %d. Number of params: %d", i, getNumberOfParams())); } boolean variadic = false; if (constructor.isVarArgs()) { variadic = i == (constructor.getParameterCount() - 1); } return new ReflectionParameterDeclaration(constructor.getParameterTypes()[i], constructor.getGenericParameterTypes()[i], typeSolver, variadic); }
@Override public ResolvedType getSpecifiedException(int index) { if (index < 0 || index >= getNumberOfSpecifiedExceptions()) { throw new IllegalArgumentException(); } return ReflectionFactory.typeUsageFor(this.constructor.getExceptionTypes()[index], typeSolver); } }
@Override public ResolvedType getSpecifiedException(int index) { if (index < 0 || index >= getNumberOfSpecifiedExceptions()) { throw new IllegalArgumentException(); } return ReflectionFactory.typeUsageFor(this.constructor.getExceptionTypes()[index], typeSolver); } }
public List<ResolvedConstructorDeclaration> getConstructors() { return Arrays.stream(clazz.getConstructors()) .map(m -> new ReflectionConstructorDeclaration(m, typeSolver)) .collect(Collectors.toList()); }
@Override public ResolvedType getSpecifiedException(int index) { if (index < 0 || index >= getNumberOfSpecifiedExceptions()) { throw new IllegalArgumentException(); } return ReflectionFactory.typeUsageFor(this.constructor.getExceptionTypes()[index], typeSolver); }
@Override public ResolvedParameterDeclaration getParam(int i) { if (i < 0 || i >= getNumberOfParams()) { throw new IllegalArgumentException(String.format("No param with index %d. Number of params: %d", i, getNumberOfParams())); } boolean variadic = false; if (constructor.isVarArgs()) { variadic = i == (constructor.getParameterCount() - 1); } return new ReflectionParameterDeclaration(constructor.getParameterTypes()[i], constructor.getGenericParameterTypes()[i], typeSolver, variadic); }
public List<ResolvedConstructorDeclaration> getConstructors() { return Arrays.stream(clazz.getConstructors()) .map(m -> new ReflectionConstructorDeclaration(m, typeSolver)) .collect(Collectors.toList()); }
@Override public ResolvedParameterDeclaration getParam(int i) { if (i < 0 || i >= getNumberOfParams()) { throw new IllegalArgumentException(String.format("No param with index %d. Number of params: %d", i, getNumberOfParams())); } boolean variadic = false; if (constructor.isVarArgs()) { variadic = i == (constructor.getParameterCount() - 1); } return new ReflectionParameterDeclaration(constructor.getParameterTypes()[i], constructor.getGenericParameterTypes()[i], typeSolver, variadic, constructor.getParameters()[i].getName()); }
public ReflectionTypeParameter(TypeVariable typeVariable, boolean declaredOnClass, TypeSolver typeSolver) { GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration(); if (genericDeclaration instanceof Class) { container = ReflectionFactory.typeDeclarationFor((Class) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Method) { container = new ReflectionMethodDeclaration((Method) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Constructor) { container = new ReflectionConstructorDeclaration((Constructor) genericDeclaration, typeSolver); } this.typeVariable = typeVariable; this.typeSolver = typeSolver; }
public ReflectionTypeParameter(TypeVariable typeVariable, boolean declaredOnClass, TypeSolver typeSolver) { GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration(); if (genericDeclaration instanceof Class) { container = ReflectionFactory.typeDeclarationFor((Class) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Method) { container = new ReflectionMethodDeclaration((Method) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Constructor) { container = new ReflectionConstructorDeclaration((Constructor) genericDeclaration, typeSolver); } this.typeVariable = typeVariable; this.typeSolver = typeSolver; }
public ReflectionTypeParameter(TypeVariable typeVariable, boolean declaredOnClass, TypeSolver typeSolver) { GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration(); if (genericDeclaration instanceof Class) { container = ReflectionFactory.typeDeclarationFor((Class) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Method) { container = new ReflectionMethodDeclaration((Method) genericDeclaration, typeSolver); } else if (genericDeclaration instanceof Constructor) { container = new ReflectionConstructorDeclaration((Constructor) genericDeclaration, typeSolver); } this.typeVariable = typeVariable; this.typeSolver = typeSolver; }