@Override final Annotation[][] getParameterAnnotations() { return method.getParameterAnnotations(); }
public Annotation[][] annotations() { if (annotations==null) annotations = method.getParameterAnnotations(); return annotations; }
/** * {@inheritDoc} */ public Annotation[][] getParameterAnnotations() { return method.getParameterAnnotations(); } }
@Override final Annotation[][] getParameterAnnotations() { return method.getParameterAnnotations(); }
@Override public boolean hasTestInstance(Method method, int i) { final Annotation[][] annotations = method.getParameterAnnotations(); if (annotations.length > 0 && annotations[i].length > 0) { final Annotation[] pa = annotations[i]; for (Annotation a : pa) { if (a instanceof TestInstance) { return true; } } } return false; }
Builder(Retrofit retrofit, Method method) { this.retrofit = retrofit; this.method = method; this.methodAnnotations = method.getAnnotations(); this.parameterTypes = method.getGenericParameterTypes(); this.parameterAnnotationsArray = method.getParameterAnnotations(); }
private static boolean hasConstraintParameter(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); if (parameterAnnotations != null && parameterAnnotations.length > 0) { for (Annotation[] annotations : parameterAnnotations) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(Constraint.class)) { return true; } } } } return false; }
private static boolean hasConstraintParameter(Method method) { Annotation[][] parameterAnnotations = method.getParameterAnnotations(); if (parameterAnnotations != null && parameterAnnotations.length > 0) { for (Annotation[] annotations : parameterAnnotations) { for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(Constraint.class)) { return true; } } } } return false; }
public CacheParameterDetail(Method method, int parameterPosition) { this.rawType = method.getParameterTypes()[parameterPosition]; this.annotations = new LinkedHashSet<>(); boolean foundKeyAnnotation = false; boolean foundValueAnnotation = false; for (Annotation annotation : method.getParameterAnnotations()[parameterPosition]) { this.annotations.add(annotation); if (CacheKey.class.isAssignableFrom(annotation.annotationType())) { foundKeyAnnotation = true; } if (CacheValue.class.isAssignableFrom(annotation.annotationType())) { foundValueAnnotation = true; } } this.parameterPosition = parameterPosition; this.isKey = foundKeyAnnotation; this.isValue = foundValueAnnotation; }
private List<Annotation[][]> getInterfaceParameterAnnotations() { List<Annotation[][]> parameterAnnotations = this.interfaceParameterAnnotations; if (parameterAnnotations == null) { parameterAnnotations = new ArrayList<>(); for (Class<?> ifc : this.method.getDeclaringClass().getInterfaces()) { for (Method candidate : ifc.getMethods()) { if (isOverrideFor(candidate)) { parameterAnnotations.add(candidate.getParameterAnnotations()); } } } this.interfaceParameterAnnotations = parameterAnnotations; } return parameterAnnotations; }
/** * {@inheritDoc} */ @CachedReturnPlugin.Enhance("parameterAnnotations") public Annotation[][] getParameterAnnotations() { return method.getParameterAnnotations(); } }
@Override public List<String> getParameterNames(Method method) { Parameter[] parameters = method.getParameters(); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); List<String> names = new ArrayList<>(parameterAnnotations.length); for (int i = 0; i < parameterAnnotations.length; i++) { Annotation[] annotations = parameterAnnotations[i]; String name = getParameterNameFromAnnotations(annotations).orElse(parameters[i].getName()); names.add(name); } return names; }
public static ArrayList<ParameterSignature> signatures(Method method) { return signatures(method.getParameterTypes(), method .getParameterAnnotations()); }
/** * Extracts method parameters. * * @param method any valid method. * @return extracted method parameters. */ public static Parameter[] getMethodParameters(final Method method) { if (method == null) { return new Parameter[]{}; } return getParameters(method.getParameterTypes(), method.getParameterAnnotations()); }
@Override public String[] findOptionalValues(Method method) { return optionalValues(method.getParameterAnnotations()); }
public static ArrayList<ParameterSignature> signatures(Method method) { return signatures(method.getParameterTypes(), method .getParameterAnnotations()); }
public List<TypeSignature> getInputTypesSignatures(Method inputFunction) { ImmutableList.Builder<TypeSignature> builder = ImmutableList.builder(); Annotation[][] parameterAnnotations = inputFunction.getParameterAnnotations(); for (Annotation[] annotations : parameterAnnotations) { for (Annotation annotation : annotations) { if (annotation instanceof SqlType) { String typeName = ((SqlType) annotation).value(); builder.add(parseTypeSignature(typeName, literalParameters)); } } } return builder.build(); }
protected AnnotatedMethod constructFactoryCreator(Method m, Method mixin) { final int paramCount = m.getParameterTypes().length; if (_intr == null) { // when annotation processing is disabled return new AnnotatedMethod(_typeContext, m, _emptyAnnotationMap(), _emptyAnnotationMaps(paramCount)); } if (paramCount == 0) { // common enough we can slightly optimize return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin), NO_ANNOTATION_MAPS); } return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin), collectAnnotations(m.getParameterAnnotations(), (mixin == null) ? null : mixin.getParameterAnnotations())); }
protected AnnotatedMethod constructFactoryCreator(Method m, Method mixin) { final int paramCount = m.getParameterTypes().length; if (_intr == null) { // when annotation processing is disabled return new AnnotatedMethod(_typeContext, m, _emptyAnnotationMap(), _emptyAnnotationMaps(paramCount)); } if (paramCount == 0) { // common enough we can slightly optimize return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin), NO_ANNOTATION_MAPS); } return new AnnotatedMethod(_typeContext, m, collectAnnotations(m, mixin), collectAnnotations(m.getParameterAnnotations(), (mixin == null) ? null : mixin.getParameterAnnotations())); }
@Override public void attach(Linker linker) { Type[] types = method.getGenericParameterTypes(); Annotation[][] annotations = method.getParameterAnnotations(); parameters = new Binding[types.length]; for (int i = 0; i < parameters.length; i++) { String key = Keys.get(types[i], annotations[i], method + " parameter " + i); parameters[i] = linker.requestBinding(key, method, instance.getClass().getClassLoader()); } }