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

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

Best Java code snippets using com.google.gwt.core.ext.typeinfo.HasAnnotations (Showing top 10 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: net.wetheinter/xapi-components

private boolean hasStyleAnnotations(final HasAnnotations member) {
 return member.isAnnotationPresent(Css.class) || member.isAnnotationPresent(Style.class);
}
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();
}
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: 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: net.wetheinter/gwt-user

final boolean keepClass = (annotationRetention | ReflectionStrategy.COMPILE) == annotationRetention;
final boolean keepRuntime = (annotationRetention | ReflectionStrategy.RUNTIME) == annotationRetention;
for (final Annotation anno : annoProvider.getDeclaredAnnotations()) {
 final Retention retention = anno.annotationType().getAnnotation(Retention.class);
 if (retention == 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()]);
}
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 true when one of the type  has the specified annotation
 *
 * @param annotation the annotation
 * @param hasAnnotationsList the types
 * @return true if one the type has the annotation
 * @param <T> a T object.
 */
public static <T extends Annotation> boolean isAnnotationPresent( Class<T> annotation, List<? extends HasAnnotations>
    hasAnnotationsList ) {
  for ( HasAnnotations accessor : hasAnnotationsList ) {
    if ( accessor.isAnnotationPresent( annotation ) ) {
      return true;
    }
  }
  return false;
}
origin: ArcBees/GWTP

public static boolean isHttpMethod(HasAnnotations hasAnnotations) {
  for (HttpVerb type : values()) {
    if (hasAnnotations.isAnnotationPresent(type.getAnnotationClass())) {
      return true;
    }
  }
  return false;
}
com.google.gwt.core.ext.typeinfoHasAnnotations

Most used methods

  • getAnnotation
  • getAnnotations
  • isAnnotationPresent
  • getDeclaredAnnotations

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • getContentResolver (Context)
  • getSystemService (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best IntelliJ 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