Package java.lang.annotation

Examples of java.lang.annotation.Annotation.annotationType()


        if (constant == null) throw new IllegalArgumentException();
       
        Annotation scope =
                ReflectionHelper.getScopeAnnotationFromObject(constant);
        Class<? extends Annotation> scopeClass = (scope == null) ? PerLookup.class :
            scope.annotationType();
       
        Set<Annotation> qualifiers =
                ReflectionHelper.getQualifiersFromObject(constant);
       
        Map<String, List<String>> metadata = new HashMap<String, List<String>>();
View Full Code Here


                if (!annotationProcessors.containsKey(annotationClass))
                    continue;
                Iterator<Annotation> itr = annotations.iterator();
                while (itr.hasNext()) {
                    Annotation previous = itr.next();
                    if (previous.annotationType() == annotationClass) {
                        itr.remove();
                    }
                }
                annotations.add(annotation);
            }
View Full Code Here

            }
            else
            {
               annotation = new PostConstructImpl();
            }
            annotationClass = annotation.annotationType();
            method.setMethodName("ejbCreate");
            addAnnotations(annotationClass, annotation, container, method);
         }

         annotation = new PostActivateImpl();
View Full Code Here

    }

    if (literalValue.getValue() instanceof Annotation) {
      final Annotation annotation = (Annotation) literalValue.getValue();

      if (annotation.annotationType().equals(Default.class)) {
        return Stmt.loadStatic(QualifierUtil.class, "DEFAULT_ANNOTATION");
      }
      else if (annotation.annotationType().equals(Any.class)) {
        return Stmt.loadStatic(QualifierUtil.class, "ANY_ANNOTATION");
      }
View Full Code Here

      final Annotation annotation = (Annotation) literalValue.getValue();

      if (annotation.annotationType().equals(Default.class)) {
        return Stmt.loadStatic(QualifierUtil.class, "DEFAULT_ANNOTATION");
      }
      else if (annotation.annotationType().equals(Any.class)) {
        return Stmt.loadStatic(QualifierUtil.class, "ANY_ANNOTATION");
      }


      final Class<? extends Annotation> aClass = annotation.annotationType();
View Full Code Here

      else if (annotation.annotationType().equals(Any.class)) {
        return Stmt.loadStatic(QualifierUtil.class, "ANY_ANNOTATION");
      }


      final Class<? extends Annotation> aClass = annotation.annotationType();
      final String fieldName = PrivateAccessUtil.condensify(aClass.getPackage().getName()) +
          aClass.getSimpleName() + "_" + String.valueOf(literalValue.getValue().hashCode()).replaceFirst("\\-", "_");

      classStructureBuilder.privateField(fieldName, annotation.annotationType())
          .modifiers(Modifier.Final).initializesWith(AnnotationEncoder.encode(annotation))
View Full Code Here

      final Class<? extends Annotation> aClass = annotation.annotationType();
      final String fieldName = PrivateAccessUtil.condensify(aClass.getPackage().getName()) +
          aClass.getSimpleName() + "_" + String.valueOf(literalValue.getValue().hashCode()).replaceFirst("\\-", "_");

      classStructureBuilder.privateField(fieldName, annotation.annotationType())
          .modifiers(Modifier.Final).initializesWith(AnnotationEncoder.encode(annotation))
          .finish();

      return Refs.get(fieldName);
    }
View Full Code Here

  }

  public boolean isElementType(final WiringElementType type, final HasAnnotations hasAnnotations) {
    final Annotation matchingAnnotation = getMatchingAnnotationForElementType(type, hasAnnotations);
    if (matchingAnnotation != null && type == WiringElementType.NotSupported) {
      log.error(hasAnnotations + " was annotated with " + matchingAnnotation.annotationType().getName()
          + " which is not supported in client-side Errai code!");
    }

    return matchingAnnotation != null;
  }
View Full Code Here

            }
            catch (Exception e)
            {

               String msg = "Not able resolve method parameter " + mp;
               Class<?> ac = a.annotationType();
               if (ac == MatrixParam.class || ac == QueryParam.class || ac == PathParam.class)
               {
                  throw new WebApplicationException(e, Response.status(Response.Status.NOT_FOUND).entity(msg).type(
                     MediaType.TEXT_PLAIN).build());
               }
View Full Code Here

            named = (Named)a;
            break;
         }
         else if (a.annotationType().isAnnotationPresent(Qualifier.class))
         {
            qualifier = a.annotationType();
            break;
         }
      }
      if (type.isInterface() && type.equals(Provider.class))
      {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.