congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Executable.getAnnotation
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: jdbi/jdbi

@Nullable
<A extends Annotation> A getAnnotation(Class<A> annotationClass) {
  return executable.getAnnotation(annotationClass);
}
origin: jooby-project/jooby

 return RouteParameter.Kind.PATH;
boolean formLike = !hasBody && p.getDeclaringExecutable().getAnnotation(POST.class) != null;
if (formLike) {
 return RouteParameter.Kind.FORM;
origin: oblac/jodd

PetiteInject petiteInject = methodOrCtor.getAnnotation(PetiteInject.class);
origin: org.jboss.weld.se/weld-se-shaded

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return executable.getAnnotation(annotationType);
}
origin: weld/core

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return executable.getAnnotation(annotationType);
}
origin: weld/core

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return executable.getAnnotation(annotationType);
}
origin: weld/core

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return executable.getAnnotation(annotationType);
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  return executable.getAnnotation(annotationType);
}
origin: com.github.XDean/Java-EX

@SuppressWarnings("unchecked")
public static <T extends Annotation> T removeAnnotation(Executable ex, Class<T> annotationType) {
 if (ex.getAnnotation(annotationType) == null) {
  return null;
 }
 ex.getAnnotation(Annotation.class);// prevent declaredAnnotations haven't initialized
 Map<Class<? extends Annotation>, Annotation> annos;
 try {
  annos = (Map<Class<? extends Annotation>, Annotation>) Field_Excutable_DeclaredAnnotations.get(ex);
 } catch (IllegalAccessException e) {
  throw new IllegalStateException(e);
 }
 return (T) annos.remove(annotationType);
}
origin: com.github.XDean/Java-EX

/**
 * Add annotation to Executable(Method or Constructor)<br>
 * Note that you may need to give the root method.
 *
 * @param ex
 * @param annotation
 * @author XDean
 * @see Executable
 * @see #createAnnotationFromMap(Class, Map)
 * @see ReflectUtil#getRootMethods(Class)
 */
@SuppressWarnings("unchecked")
public static void addAnnotation(Executable ex, Annotation annotation) {
 ex.getAnnotation(Annotation.class);// prevent declaredAnnotations haven't initialized
 Map<Class<? extends Annotation>, Annotation> annos;
 try {
  annos = (Map<Class<? extends Annotation>, Annotation>) Field_Excutable_DeclaredAnnotations.get(ex);
 } catch (IllegalAccessException e) {
  throw new IllegalStateException(e);
 }
 if (annos.getClass() == Collections.EMPTY_MAP.getClass()) {
  annos = new HashMap<>();
  try {
   Field_Excutable_DeclaredAnnotations.set(ex, annos);
  } catch (IllegalAccessException e) {
   throw new IllegalStateException(e);
  }
 }
 annos.put(annotation.annotationType(), annotation);
}
origin: btrplace/scheduler

  public List<TestCampaign> testGroups(String... groups) throws IllegalAccessException, InvocationTargetException, InstantiationException {
    List<Executable> ms = new ArrayList<>();
    Set<String> ok = Stream.of(groups).collect(Collectors.toSet());

    FastClasspathScanner scanner = new FastClasspathScanner();
    scanner.matchClassesWithMethodAnnotation(CstrTest.class, (cl, m) -> {
      CstrTest a = m.getAnnotation(CstrTest.class);
      for (String g : a.groups()) {
        if (ok.contains(g)) {
          ms.add(m);
        }
      }
    }).scan(Runtime.getRuntime().availableProcessors() - 1);
    return test(ms.toArray(new Method[ms.size()]));
  }
}
origin: io.astefanutti.metrics.cdi/metrics-cdi

private <T extends Annotation> Of<T> elementResolverOf(Executable executable, Class<T> metric) {
  T annotation = executable.getAnnotation(metric);
  String name = metricName(executable, metric, metricName(annotation), isMetricAbsolute(annotation));
  return new DoesHaveMetric<>(annotation, name);
}
origin: astefanutti/metrics-cdi

private <T extends Annotation> Of<T> elementResolverOf(Executable executable, Class<T> metric) {
  T annotation = executable.getAnnotation(metric);
  String name = metricName(executable, metric, metricName(annotation), isMetricAbsolute(annotation));
  return new DoesHaveMetric<>(annotation, name);
}
origin: org.jooby/jooby-apitool

 return RouteParameter.Kind.PATH;
boolean formLike = !hasBody && p.getDeclaringExecutable().getAnnotation(POST.class) != null;
if (formLike) {
 return RouteParameter.Kind.FORM;
origin: org.jodd/jodd-petite

PetiteInject petiteInject = methodOrCtor.getAnnotation(PetiteInject.class);
java.lang.reflectExecutablegetAnnotation

Popular methods of Executable

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

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Reference (javax.naming)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Option (scala)
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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