Examples of annotationType()


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

         if (a instanceof Named)
         {
            named = (Named)a;
            break;
         }
         else if (a.annotationType().isAnnotationPresent(Qualifier.class))
         {
            qualifier = a.annotationType();
            break;
         }
      }
View Full Code Here

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

            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

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

            }
            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

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

               p[i] = pr.resolve(cp, context);
            }
            catch (Exception e)
            {
               String msg = "Not able resolve constructor parameter " + cp;
               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());

               throw new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).entity(msg)
View Full Code Here

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

  private boolean checkForAppropriateAnnotation(Set<ConstraintDescriptor<?>> constraintDescriptors) {
    boolean findPattern = false;
    for ( ConstraintDescriptor<?> constraintDescriptor : constraintDescriptors ) {
      Annotation ann = constraintDescriptor.getAnnotation();
      if ( Pattern.class.getName().equals( ann.annotationType().getName() ) ) {
        String regexp = ( (Pattern) ann ).regexp();
        if ( regexp.equals( "bar" ) ) {
          fail( "The regular expression attributes are defined in the composing constraint." );
        }
        findPattern = true;
View Full Code Here

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

  
   public void testDefaultValues() throws Exception
   {
      String expr = "@org.jboss.test.annotation.factory.support.ComplexWithDefault";
      Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(expr, ComplexWithDefault.class);
      assertEquals(ComplexWithDefault.class, annotation.annotationType());
      ComplexWithDefault complex = (ComplexWithDefault)annotation;
      assertEquals('d', complex.ch());
      assertEquals("default", complex.string());
      assertEquals(1.0, complex.flt());
      assertEquals(2.3, complex.dbl());
View Full Code Here

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

        }

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

          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

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

          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

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

         for (Object o : objects)
         {
            if (o instanceof Annotation)
            {
               Annotation a = (Annotation) o;
               if (name.equals(a.annotationType().getName()))
                  return o;
            }
            else if (name.equals(o.getClass().getName()))
               return o;
         }
View Full Code Here

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

         {
            Object o = item.getValue();
            if (o instanceof Annotation)
            {
               Annotation a = (Annotation) o;
               if (name.equals(a.annotationType().getName()))
                  return item;
            }
            else if (name.equals(item.getName()))
               return item;
         }
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.