Package java.lang.annotation

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


        }
        WebParam webParam = null;
        for (int i = 0; i < annotations[parameter].length; i++)
        {
            Annotation annotation = annotations[parameter][i];
            if (annotation.annotationType().equals(WebParam.class))
            {
                webParam = (WebParam) annotations[parameter][i];
                break;
            }
        }
View Full Code Here


        Annotation[] annotations = m.getParameterAnnotations()[index];

        for (int i = 0; i < annotations.length; i++)
        {
            Annotation annotation = annotations[i];
            if (annotation.annotationType().equals(XmlParamType.class))
            {
                return (XmlParamType) annotations[i];
            }
        }
View Full Code Here

        else
        {
            for (int i = 0; i < annotations[parameter].length; i++)
            {
                Annotation annotation = annotations[parameter][i];
                if (annotation.annotationType().equals(WebParam.class))
                {
                    return true;
                }
            }
            return false;
View Full Code Here

      fail("Instance constructor is missing FooAnnotation.");
    }

    // check for parameter annotation
    Annotation paramAnnotation = ctor.getParameterAnnotations()[0][0];
    assertEquals(paramAnnotation.annotationType(), BarAnnotation.class);
  }
}
View Full Code Here

      BeanMetaData bmd = akcc.getBeanMetaData();
      Set<AnnotationMetaData> annotations = bmd.getAnnotations();
      for (AnnotationMetaData annotationMetaData : annotations)
      {
         Annotation annotation = annotationMetaData.getAnnotationInstance();
         if (annotation.annotationType() == Password.class)
         {
            passwordAnnotations.add((Password) annotation);
         }
      }
      return passwordAnnotations;
View Full Code Here

            for (int ix = 0; ix < paramAnnotationArrays.length; ix++) {
                final Annotation[] paramAnnotations = paramAnnotationArrays[ix];
                if (paramAnnotations != null && paramAnnotations.length > 0) {
                    for (int jx = 0; jx < paramAnnotations.length; jx++) {
                        final Annotation paramAnnotation = paramAnnotations[jx];
                        if (ParameterDataUpdateContent.class.equals(paramAnnotation.annotationType())) {
                            if (foundIndex >= 0) {
                                throw new InvalidParameterException(String.format(
                                        "Multiple annotations of type [%s] found on method [%s]",
                                        ParameterDataUpdateContent.class.getName(),
                                        targetMethod.getName()
View Full Code Here

            for (int ix = 0; ix < paramAnnotationArrays.length; ix++) {
                final Annotation[] paramAnnotations = paramAnnotationArrays[ix];
                if (paramAnnotations != null && paramAnnotations.length > 0) {
                    for (int jx = 0; jx < paramAnnotations.length; jx++) {
                        final Annotation paramAnnotation = paramAnnotations[jx];
                        if (ParameterValueKeyProvider.class.equals(paramAnnotation.annotationType())) {
                            if (foundIndex >= 0) {
                                throw new InvalidParameterException(String.format(
                                        "Multiple annotations of type [%s] found on method [%s]",
                                        ParameterValueKeyProvider.class.getName(),
                                        targetMethod.getName()
View Full Code Here

          String id = null;
          try {
            id = (String) annotation.getClass().getMethod("value").invoke(annotation);
          } catch (Exception e) {
            throw new JibeRuntimeException("Annotation does not have value property: "
                + annotation.annotationType().getName());
          }

          if (StringUtils.isEmpty(id)) {
            id = String.format("%1$s.%2$s", beanName, method.getName());
          }
View Full Code Here

            // When assembling class annotations from a base class, you want to ignore any
            // that are not @Inherited.

            if (filterNonInherited)
            {
                Class<? extends Annotation> annotationType = a.annotationType();

                Inherited inherited = annotationType.getAnnotation(Inherited.class);

                if (inherited == null)
                    continue;
View Full Code Here

            public Class<? extends Annotation> annotationType() {
                return Ignore.class;
            }
        };

        assertEquals(Ignore.class, annotation.annotationType());
    }

    private Description describe(Class<?> testClass) {
        return Request.aClass(testClass).getRunner().getDescription();
    }
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.