Package java.lang.annotation

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



    public static boolean hasAnnotation(CtClass ctClass, String annotation) throws ClassNotFoundException {
        for (Object object : ctClass.getAvailableAnnotations()) {
            Annotation ann = (Annotation) object;
            if (ann.annotationType().getName().equals(annotation)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here



    public static boolean hasAnnotationWithPrefix(CtClass ctClass, String annotationPrefix) throws ClassNotFoundException {
        for (Object object : ctClass.getAvailableAnnotations()) {
            Annotation ann = (Annotation) object;
            if (ann.annotationType().getName().startsWith(annotationPrefix)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


    public static boolean hasAnnotation(CtField ctField, String annotation) throws ClassNotFoundException {
        for (Object object : ctField.getAvailableAnnotations()) {
            Annotation ann = (Annotation) object;
            if (ann.annotationType().getName().equals(annotation)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    }

    public static boolean hasAnnotation(CtMethod ctMethod, String annotation) throws ClassNotFoundException {
        for (Object object : ctMethod.getAvailableAnnotations()) {
            Annotation ann = (Annotation) object;
            if (ann.annotationType().getName().equals(annotation)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

         if (a instanceof Named)
         {
            named = (Named)a;
            break;
         }
         else if (a.annotationType().isAnnotationPresent(Qualifier.class))
         {
            qualifier = a.annotationType();
            break;
         }
      }
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

      if (!(other instanceof Annotation)) {
        return false;
      }

      Annotation otherAnnotation = (Annotation) other;
      if (annotationClass != otherAnnotation.annotationType()) {
        return false;
      }

      try {
        for (Method method : annotationClass.getDeclaredMethods()) {
View Full Code Here

         if (annotationMetaData != null)
         {
            for (AnnotationMetaData annMeta : annotationMetaData)
            {
               Annotation ann = annMeta.getAnnotationInstance();
               if (ann.annotationType() == InterceptMC.class)
               {
                  interceptAnnotation = (InterceptMC) ann;
               }
            }
         }
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 (!(other instanceof Annotation)) {
        return false;
      }

      Annotation otherAnnotation = (Annotation) other;
      if (annotationClass != otherAnnotation.annotationType()) {
        return false;
      }

      try {
        for (Method method : annotationClass.getDeclaredMethods()) {
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.