Codota Logo
Executable.getAnnotation
Code IndexAdd Codota 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)

  • Common ways to obtain Executable
private void myMethod () {
Executable e =
  • Codota IconParameter parameter;parameter.getDeclaringExecutable()
  • Codota IconInjectionPoint injectionPoint;(Executable) injectionPoint.getMember()
  • Codota IconParameterContext parameterContext;parameterContext.getDeclaringExecutable()
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now