Tabnine Logo
HasAnnotations.getAnnotation
Code IndexAdd Tabnine to your IDE (free)

How to use
getAnnotation
method
in
com.google.gwt.core.ext.typeinfo.HasAnnotations

Best Java code snippets using com.google.gwt.core.ext.typeinfo.HasAnnotations.getAnnotation (Showing top 4 results out of 315)

origin: net.wetheinter/xapi-gwt-reflect

 @Override
 public synchronized ReflectionManifest get(Object key) {
  ReflectionManifest value = super.get(key);
  if (value == null) {
   value = new ReflectionManifest();
   @SuppressWarnings("unchecked") // private class
   K type = (K)key;
   value.cls = type.getAnnotation(KeepClass.class);
   value.method = type.getAnnotation(KeepMethod.class);
   value.field = type.getAnnotation(KeepField.class);
   value.constructor = type.getAnnotation(KeepConstructor.class);
   value.anno = type.getAnnotation(KeepAnnotation.class);
   put(type, value);
  }
  return value;
 }
}
origin: resty-gwt/resty-gwt

public static <T extends Annotation> T getAnnotation(HasAnnotations classType, Class<T> annotationType) {
  try {
    T ann = classType.getAnnotation(annotationType);
    if (ann == null) {
      for (Annotation metaAnn : classType.getAnnotations()) {
        // only return a custom annotation if it contains the JacksonAnnotationsInside annotation
        if (metaAnn.annotationType().getAnnotation(JacksonAnnotationsInside.class) != null) {
          ann = metaAnn.annotationType().getAnnotation(annotationType);
          if (ann != null) {
            break;
          }
        }
      }
    }
    return ann;
  } catch (Exception ex) {
    return null;
  }
}
origin: org.fusesource.restygwt/restygwt

public static <T extends Annotation> T getAnnotation(HasAnnotations classType, Class<T> annotationType) {
  try {
    T ann = classType.getAnnotation(annotationType);
    if (ann == null) {
      for (Annotation metaAnn : classType.getAnnotations()) {
        // only return a custom annotation if it contains the JacksonAnnotationsInside annotation
        if (metaAnn.annotationType().getAnnotation(JacksonAnnotationsInside.class) != null) {
          ann = metaAnn.annotationType().getAnnotation(annotationType);
          if (ann != null) {
            break;
          }
        }
      }
    }
    return ann;
  } catch (Exception ex) {
    return null;
  }
}
origin: nmorel/gwt-jackson

/**
 * Returns the first occurence of the annotation found on the types
 *
 * @param annotation the annotation
 * @param hasAnnotationsList the types
 * @return the first occurence of the annotation found on the types
 * @param <T> a T object.
 */
public static <T extends Annotation> Optional<T> getAnnotation( Class<T> annotation, List<? extends HasAnnotations>
    hasAnnotationsList ) {
  for ( HasAnnotations accessor : hasAnnotationsList ) {
    if ( accessor.isAnnotationPresent( annotation ) ) {
      return Optional.of( accessor.getAnnotation( annotation ) );
    }
  }
  return Optional.absent();
}
com.google.gwt.core.ext.typeinfoHasAnnotationsgetAnnotation

Popular methods of HasAnnotations

  • getAnnotations
  • isAnnotationPresent
  • getDeclaredAnnotations

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Permission (java.security)
    Legacy security code; do not use.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • From CI to AI: The AI layer in your organization
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