Package java.lang.annotation

Examples of java.lang.annotation.Retention


  }

  @Override
  public Set<ConstraintCheckError> checkAnnotationType(TypeElement element, AnnotationMirror annotation) {

    Retention retention = element.getAnnotation( Retention.class );

    if ( retention == null ) {
      return CollectionHelper.asSet(
          new ConstraintCheckError( element, null, "CONSTRAINT_TYPE_WITH_MISSING_OR_WRONG_RETENTION" )
      );
    }

    if ( !retention.value().equals( RetentionPolicy.RUNTIME ) ) {
      return CollectionHelper.asSet(
          new ConstraintCheckError(
              element,
              annotationApiHelper.getMirror( element.getAnnotationMirrors(), Retention.class ),
              "CONSTRAINT_TYPE_WITH_MISSING_OR_WRONG_RETENTION"
View Full Code Here


    public static void checkEventBindings(WebBeansContext webBeansContext, Annotation... annotations)
    {
        for(Annotation ann : annotations)
        {
            //This is added, because TCK Event tests for this.
            Retention retention = ann.annotationType().getAnnotation(Retention.class);
            RetentionPolicy policy = retention.value();
            if(!policy.equals(RetentionPolicy.RUNTIME))
            {
                throw new IllegalArgumentException("Event qualifiere RetentionPolicy must be RUNTIME for qualifier : " + ann);
            }
            ///////////////////////////////////////////////////////
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

  }
 
  public boolean isAnnotationWithRuntimeRetention() {
    if (!isAnnotation()) return false;
    if (getBaseClass().isAnnotationPresent(Retention.class)) {
      Retention retention = (Retention) getBaseClass().getAnnotation(Retention.class);
      RetentionPolicy policy = retention.value();
      return policy == RetentionPolicy.RUNTIME;
    } else {
      return false;
    }
  }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

   {
      try
      {
         Class ann = classloader.loadClass(annotation);
         if (!ann.isAnnotation()) return null;
         Retention retention = (Retention) ann.getAnnotation(Retention.class);
         if (retention != null && retention.value() == RetentionPolicy.RUNTIME) return ann;

      }
      catch (ClassNotFoundException ignored)
      {
      }
View Full Code Here

TOP

Related Classes of java.lang.annotation.Retention

Copyright © 2018 www.massapicom. 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.