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

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

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

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: errai/errai

/**
 * Overloaded version to check GWT's JClassType classes.
 *
 * @param type
 * @param hasAnnotations
 *
 * @return
 */
public boolean isElementType(final WiringElementType type,
               final com.google.gwt.core.ext.typeinfo.HasAnnotations hasAnnotations) {
 final Collection<Class<? extends Annotation>> annotationsForElementType = getAnnotationsForElementType(type);
 for (final Annotation a : hasAnnotations.getAnnotations()) {
  if (annotationsForElementType.contains(a.annotationType())) {
   return true;
  }
 }
 return false;
}
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: net.wetheinter/gwt-reflect

public static Annotation[] extractAnnotations(int annotationRetention,
  HasAnnotations method) {
 ArrayList<Annotation> annos = new ArrayList<Annotation>();
 boolean keepClass = (annotationRetention | ReflectionStrategy.COMPILE) == annotationRetention;
 boolean keepRuntime = (annotationRetention | ReflectionStrategy.RUNTIME) == annotationRetention;
 for (Annotation anno : method.getAnnotations()) {
  Retention retention = anno.annotationType().getAnnotation(Retention.class);
  if (retention == null) {
   if (keepClass)
    annos.add(anno);
  } else {
   switch (retention.value()) {
    case CLASS:
     if (keepClass)
      annos.add(anno);
     break;
    case RUNTIME:
     if (keepRuntime)
      annos.add(anno);
    default:
   }
  }
 }
 return annos.toArray(new Annotation[annos.size()]);
}
com.google.gwt.core.ext.typeinfoHasAnnotationsgetAnnotations

Popular methods of HasAnnotations

  • getAnnotation
  • isAnnotationPresent
  • getDeclaredAnnotations

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top PhpStorm plugins
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