congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Executable.getParameterAnnotations
Code IndexAdd Tabnine to your IDE (free)

How to use
getParameterAnnotations
method
in
java.lang.reflect.Executable

Best Java code snippets using java.lang.reflect.Executable.getParameterAnnotations (Showing top 14 results out of 315)

origin: spring-projects/spring-framework

/**
 * Return the annotations associated with the specific method/constructor parameter.
 */
public Annotation[] getParameterAnnotations() {
  Annotation[] paramAnns = this.parameterAnnotations;
  if (paramAnns == null) {
    Annotation[][] annotationArray = this.executable.getParameterAnnotations();
    int index = this.parameterIndex;
    if (this.executable instanceof Constructor &&
        ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
        annotationArray.length == this.executable.getParameterCount() - 1) {
      // Bug in javac in JDK <9: annotation array excludes enclosing instance parameter
      // for inner classes, so access it with the actual parameter index lowered by 1
      index = this.parameterIndex - 1;
    }
    paramAnns = (index >= 0 && index < annotationArray.length ?
        adaptAnnotationArray(annotationArray[index]) : EMPTY_ANNOTATION_ARRAY);
    this.parameterAnnotations = paramAnns;
  }
  return paramAnns;
}
origin: spring-projects/spring-framework

Executable executable = parameter.getDeclaringExecutable();
if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) &&
    executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
origin: org.springframework/spring-core

/**
 * Return the annotations associated with the specific method/constructor parameter.
 */
public Annotation[] getParameterAnnotations() {
  Annotation[] paramAnns = this.parameterAnnotations;
  if (paramAnns == null) {
    Annotation[][] annotationArray = this.executable.getParameterAnnotations();
    int index = this.parameterIndex;
    if (this.executable instanceof Constructor &&
        ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
        annotationArray.length == this.executable.getParameterCount() - 1) {
      // Bug in javac in JDK <9: annotation array excludes enclosing instance parameter
      // for inner classes, so access it with the actual parameter index lowered by 1
      index = this.parameterIndex - 1;
    }
    paramAnns = (index >= 0 && index < annotationArray.length ?
        adaptAnnotationArray(annotationArray[index]) : EMPTY_ANNOTATION_ARRAY);
    this.parameterAnnotations = paramAnns;
  }
  return paramAnns;
}
origin: org.junit.jupiter/junit-jupiter-engine

&& executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
origin: com.oracle.substratevm/library-support

  @Override
  public Object compute(MetaAccessProvider metaAccess, ResolvedJavaField original, ResolvedJavaField annotated, Object receiver) {
    Executable executable = (Executable) receiver;
    return executable.getParameterAnnotations();
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.moxy

  private boolean detectParameterConstraints(Executable c) {
    for (Annotation[] aa : c.getParameterAnnotations())
      for (Annotation a : aa) {
        final Class<? extends Annotation> annType = a.annotationType();
        if (knownConstraints.contains(annType)) {
          return true;
        }
        // detect custom annotations
        for (Annotation annOnAnnType : annType.getAnnotations()) {
          final Class<? extends Annotation> annTypeOnAnnType = annOnAnnType.annotationType();
          if (Constraint.class == annTypeOnAnnType) {
            knownConstraints.add(annType);
            return true;
          }
        }
      }
    return false;
  }
}
origin: com.github.XDean/spring-annotation

/**
 * Return the annotations associated with the specific method/constructor parameter.
 */
public Annotation[] getParameterAnnotations() {
 Annotation[] paramAnns = this.parameterAnnotations;
 if (paramAnns == null) {
  Annotation[][] annotationArray = this.executable.getParameterAnnotations();
  if (this.parameterIndex >= 0 && this.parameterIndex < annotationArray.length) {
   paramAnns = adaptAnnotationArray(annotationArray[this.parameterIndex]);
  } else {
   paramAnns = new Annotation[0];
  }
  this.parameterAnnotations = paramAnns;
 }
 return paramAnns;
}
origin: com.fitbur.core/core-hk2

public <T extends Annotation> Optional<T> findParameter(Injectee injectee, Class<T> type) {
  AnnotatedElement parent = injectee.getParent();
  Optional<T> annotation;
  if (parent instanceof Field) {
    Field field = (Field) parent;
    annotation = Optional.ofNullable(field.getAnnotation(type));
  } else {
    Executable executable = (Executable) parent;
    Annotation[][] annotations = executable.getParameterAnnotations();
    Annotation[] params = annotations[injectee.getPosition()];
    annotation = Stream.of(params)
        .parallel()
        .filter(p -> type.equals(p.annotationType()))
        .map(p -> (T) p)
        .findFirst();
  }
  return annotation;
}
origin: weld/weld-junit

private static List<Class<?>> getExecutableParameterTypes(Executable executable, Weld weld, boolean explicitInjection) {
  List<Class<?>> types = new ArrayList<>();
  if (explicitInjection) {
    Annotation[][] paramAnns = executable.getParameterAnnotations();
    Class<?>[] paramTypes = executable.getParameterTypes();
    for (int c = 0; c < paramAnns.length; ++c) {
      if (stream(paramAnns[c]).anyMatch(ann -> isAnnotated(ann.annotationType(), Qualifier.class) || isAnnotated(ann.annotationType(), NormalScope.class))) {
        weld.addBeanClass(paramTypes[c]);
        types.add(paramTypes[c]);
      }
    }
  } else {
    for (Class<?> paramType : executable.getParameterTypes()) {
      weld.addBeanClass(paramType);
      types.add(paramType);
    }
  }
  return types;
}
origin: org.jboss.weld/weld-junit5

private static List<Class<?>> getExecutableParameterTypes(Executable executable, Weld weld, boolean explicitInjection) {
  List<Class<?>> types = new ArrayList<>();
  if (explicitInjection) {
    Annotation[][] paramAnns = executable.getParameterAnnotations();
    Class<?>[] paramTypes = executable.getParameterTypes();
    for (int c = 0; c < paramAnns.length; ++c) {
      if (stream(paramAnns[c]).anyMatch(ann -> isAnnotated(ann.annotationType(), Qualifier.class) || isAnnotated(ann.annotationType(), NormalScope.class))) {
        weld.addBeanClass(paramTypes[c]);
        types.add(paramTypes[c]);
      }
    }
  } else {
    for (Class<?> paramType : executable.getParameterTypes()) {
      weld.addBeanClass(paramType);
      types.add(paramType);
    }
  }
  return types;
}
origin: org.minijax/minijax-core

private Provider<?>[] getParamProviders(final Key<?> key, final Executable executable, final Set<Key<?>> chain) {
  final Class<?>[] paramClasses = executable.getParameterTypes();
  final Type[] paramTypes = executable.getGenericParameterTypes();
  final Annotation[][] annotations = executable.getParameterAnnotations();
  final Provider<?>[] result = new Provider<?>[paramTypes.length];
  for (int i = 0; i < paramTypes.length; ++i) {
    result[i] = getParamProvider(key, paramClasses[i], paramTypes[i], annotations[i], chain);
  }
  return result;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core

/**
 * Return the annotations associated with the specific method/constructor parameter.
 */
public Annotation[] getParameterAnnotations() {
  Annotation[] paramAnns = this.parameterAnnotations;
  if (paramAnns == null) {
    Annotation[][] annotationArray = this.executable.getParameterAnnotations();
    int index = this.parameterIndex;
    if (this.executable instanceof Constructor &&
        ClassUtils.isInnerClass(this.executable.getDeclaringClass()) &&
        annotationArray.length == this.executable.getParameterCount() - 1) {
      // Bug in javac in JDK <9: annotation array excludes enclosing instance parameter
      // for inner classes, so access it with the actual parameter index lowered by 1
      index = this.parameterIndex - 1;
    }
    paramAnns = (index >= 0 && index < annotationArray.length ?
        adaptAnnotationArray(annotationArray[index]) : EMPTY_ANNOTATION_ARRAY);
    this.parameterAnnotations = paramAnns;
  }
  return paramAnns;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

Executable executable = parameter.getDeclaringExecutable();
if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) &&
    executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
origin: apache/servicemix-bundles

Executable executable = parameter.getDeclaringExecutable();
if (executable instanceof Constructor && ClassUtils.isInnerClass(executable.getDeclaringClass()) &&
    executable.getParameterAnnotations().length == executable.getParameterCount() - 1) {
java.lang.reflectExecutablegetParameterAnnotations

Popular methods of Executable

  • getParameters
  • getDeclaringClass
  • getParameterTypes
  • getName
  • getParameterCount
  • toGenericString
  • getGenericParameterTypes
  • getModifiers
  • getAnnotation
  • getAnnotations
  • isAnnotationPresent
  • isVarArgs
  • isAnnotationPresent,
  • isVarArgs,
  • getAnnotatedParameterTypes,
  • getAnnotatedReturnType,
  • getAnnotatedReceiverType,
  • getGenericExceptionTypes,
  • isSynthetic,
  • <init>,
  • getAnnotatedExceptionTypes

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Join (org.hibernate.mapping)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now