public static <X> AnnotatedParameter<X> of(Type baseType, Annotation[] annotations, int position, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache sharedObjectCache) { return new BackedAnnotatedParameter<X>(baseType, annotations, position, declaringCallable, sharedObjectCache); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; }
public SerializationProxy(BackedAnnotatedParameter<X> parameter) { this.callable = parameter.getDeclaringCallable(); this.position = parameter.getPosition(); }
@Override protected List<AnnotatedParameter<X>> initParameters(Method method, SharedObjectCache sharedObjectCache) { final Type[] genericParameterTypes = method.getGenericParameterTypes(); List<AnnotatedParameter<X>> parameters = new ArrayList<AnnotatedParameter<X>>(genericParameterTypes.length); Annotation[][] parameterAnnotations = method.getParameterAnnotations(); for (int i = 0; i < genericParameterTypes.length; i++) { Type parameterType = genericParameterTypes[i]; parameters.add(BackedAnnotatedParameter.of(parameterType, parameterAnnotations[i], i, this, sharedObjectCache)); } return immutableListView(parameters); }
@Override protected ReflectionCache getReflectionCache() { return getDeclaringCallable().getDeclaringType().getReflectionCache(); } }
@Override public <T extends Annotation> T getAnnotation(Class<T> annotationType) { for (Annotation annotation : getAnnotations()) { if (annotation.annotationType().equals(annotationType)) { return cast(annotation); } } return null; }
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getAnnotations(parameter); }
protected List<AnnotatedParameter<X>> initParameters(E member, SharedObjectCache sharedObjectCache) { return BackedAnnotatedParameter.forExecutable(member, this, sharedObjectCache); }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
@Override protected ReflectionCache getReflectionCache() { return getDeclaringCallable().getDeclaringType().getReflectionCache(); } }
@Override public <T extends Annotation> T getAnnotation(Class<T> annotationType) { for (Annotation annotation : getAnnotations()) { if (annotation.annotationType().equals(annotationType)) { return cast(annotation); } } return null; }
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getParameterAnnotationSet(this); }
protected List<AnnotatedParameter<X>> initParameters(E member, SharedObjectCache sharedObjectCache) { return BackedAnnotatedParameter.forExecutable(member, this, sharedObjectCache); }
public SerializationProxy(BackedAnnotatedParameter<X> parameter) { this.callable = parameter.getDeclaringCallable(); this.position = parameter.getPosition(); }
public static <X> AnnotatedParameter<X> of(Parameter parameter, int position, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache sharedObjectCache) { return new BackedAnnotatedParameter<X>(parameter, position, declaringCallable, sharedObjectCache); }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }
@Override protected ReflectionCache getReflectionCache() { return getDeclaringCallable().getDeclaringType().getReflectionCache(); } }
@Override public <T extends Annotation> T getAnnotation(Class<T> annotationType) { for (Annotation annotation : getAnnotations()) { if (annotation.annotationType().equals(annotationType)) { return cast(annotation); } } return null; }
@Override public Set<Annotation> getAnnotations() { return getReflectionCache().getAnnotations(parameter); }
@Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return getAnnotation(annotationType) != null; }