@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
private Object create(Method method, Object[] args) { Builder subBuilder = new Injector.Builder(Injector.this); AnnotatedType[] parameterTypes = method.getAnnotatedParameterTypes(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); for (int i = 0; i < args.length; i++) { Type paramType = parameterTypes[i].getType(); String name = findName(parameterAnnotations[i]); Object arg = args[i]; subBuilder.bind(new Key<>(paramType, name), arg); } Class<?> returnType = method.getReturnType(); Key<T> targetKey = new Key<>(returnType); Injector subInjector = subBuilder.build(); Provider<T> provider = subInjector.findLocalProvider(targetKey); if (provider == null) { throw new InjectionException(targetKey, "huh?"); } return provider.get(); } }
@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
@Override AnnotatedType[] getAnnotatedParameterTypes() { return method.getAnnotatedParameterTypes(); }
/** * Returns an array of {@code AnnotatedType} objects that represent the use * of types to specify formal parameter types of the method/constructor * represented by this Executable. The order of the objects in the array * corresponds to the order of the formal parameter types in the * declaration of the method/constructor. * * Returns an array of length 0 if the method/constructor declares no * parameters. * * @return an array of objects representing the types of the formal parameters of the method or constructor represented by this {@code Executable} */ public AnnotatedType[] getAnnotatedParameterTypes() { return this.method.getAnnotatedParameterTypes(); }
@NotNull @Override public List<String> getParameterAnnotations(@Nullable NavigatablePsiElement method, int paramIndex) { if (method == null) return Collections.emptyList(); Method delegate = ((MyElement<Method>)method).delegate; AnnotatedType[] parameterTypes = delegate.getAnnotatedParameterTypes(); if (paramIndex < 0 || paramIndex >= parameterTypes.length) return Collections.emptyList(); return getAnnotationsInner(delegate); }
public TypeUse.TypeInternal forParam(ProcessingEnvironment env, ExecutableElement methodElt, int paramIndex) { Method methodRef = getMethod(env, methodElt); if (methodRef == null) { return null; } AnnotatedType annotated = methodRef.getAnnotatedParameterTypes()[paramIndex]; return new ReflectType(annotated); } public TypeUse.TypeInternal forReturn(ProcessingEnvironment env, ExecutableElement methodElt) {
if (f.hasRequestParameter) { AnnotatedType request = f.method.getAnnotatedParameterTypes()[0]; @SuppressWarnings("unchecked") Class<? extends RESTRequest> requestClass = (Class<? extends RESTRequest>) request