Package java.lang.annotation

Examples of java.lang.annotation.Target


            {
                throw new WebBeansConfigurationException("@StereoType annotation can not define @Qualifier annotation");
            }
            else if (AnnotationUtil.isInterceptorBindingAnnotation(annotType))
            {
                Target target = clazz.getAnnotation(Target.class);
                ElementType[] type = target.value();

                if (type.length != 1 && !type[0].equals(ElementType.TYPE))
                {
                    throw new WebBeansConfigurationException("Stereotype with @InterceptorBinding must be defined as @Target{TYPE}");
                }
View Full Code Here


        if (AnnotationUtil.hasStereoTypeMetaAnnotation(annotations))
        {
            Annotation[] isy = AnnotationUtil.getStereotypeMetaAnnotations(annotations);

            Target outerStereo = clazz.getAnnotation(Target.class);
            for (Annotation is : isy)
            {
                Target innerStereo = is.annotationType().getAnnotation(Target.class);

                ElementType[] innerValues = innerStereo.value();
                ElementType[] outerValues = outerStereo.value();

                for (ElementType innerValue : innerValues)
                {
                    if (innerValue.equals(ElementType.METHOD) || innerValue.equals(ElementType.FIELD))
View Full Code Here

                    defaultScopeType = defaultAnn;
                    scopeTypeFound = true;
                }               
                else if (AnnotationUtil.isInterceptorBindingAnnotation(annClazz))
                {
                    Target target = clazz.getAnnotation(Target.class);
                    ElementType[] type = target.value();

                    if (type.length != 1 && !type[0].equals(ElementType.TYPE))
                    {
                        throw new WebBeansConfigurationException(errorMessage + "Stereotype with @InterceptorBinding must be defined as @Target{TYPE}");
                    }

                    interceptorBindingTypes.add(XMLUtil.getXMLDefinedAnnotationMember(child, annClazz, errorMessage));
                }
                else if (clazz.equals(Named.class))
                {
                    defaultName = defaultAnn;
                    Named name = (Named) defaultName;
                    if (!name.value().equals(""))
                    {
                        throw new WebBeansConfigurationException(errorMessage + "@StereoType annotation can not define @Named annotation with value");
                    }
                }
                else if (AnnotationUtil.isQualifierAnnotation(annClazz))
                {
                    throw new WebBeansConfigurationException(errorMessage + "@StereoType annotation can not define @Qualifier annotation");
                }

                else if (AnnotationUtil.isStereoTypeAnnotation(annClazz))
                {
                    Target innerStereo = clazz.getAnnotation(Target.class);
                    Class<?> outerStereoClass = XMLUtil.getElementJavaType(stereoTypeDecleration);
                    Target outerStereo = outerStereoClass.getAnnotation(Target.class);

                    ElementType[] innerValues = innerStereo.value();
                    ElementType[] outerValues = outerStereo.value();

                    for (ElementType innerValue : innerValues)
                    {
                        if (innerValue.equals(ElementType.METHOD) || innerValue.equals(ElementType.FIELD))
                        {
View Full Code Here

        {
            Annotation[] anns = AnnotationUtil.getInterceptorBindingMetaAnnotations(annots);

            for (Annotation annotation : anns)
            {
                Target target = annotation.annotationType().getAnnotation(Target.class);
                ElementType[] elementTypes = target.value();

                if (!(elementTypes.length == 1 && elementTypes[0].equals(ElementType.TYPE)))
                {
                    throw new WebBeansConfigurationException(errorMessage);
                }
View Full Code Here

        {
            Annotation[] anns = AnnotationUtil.getInterceptorBindingMetaAnnotations(annots);

            for (Annotation annotation : anns)
            {
                Target target = annotation.annotationType().getAnnotation(Target.class);
                ElementType[] elementTypes = target.value();

                if (!(elementTypes.length == 1 && elementTypes[0].equals(ElementType.TYPE)))
                {
                    throw new WebBeansConfigurationException(errorMessage);
                }
View Full Code Here

  @Override
  public final Description matchClass(ClassTree classTree, VisitorState state) {
    Symbol classSymbol = ASTHelpers.getSymbol(classTree);
    if ((classSymbol.flags() & Flags.ANNOTATION) != 0
        && SCOPE_ANNOTATION_MATCHER.matches(classTree, state)) {
      Target target = ASTHelpers.getAnnotation(classSymbol, Target.class);
      boolean hasExclusivelyTypeAndOrMethodTargeting = false;
      if (target != null) {
        for (ElementType elementType : target.value()) {
          if (elementType != METHOD && elementType != TYPE) {
            return describe(classTree, state);
          } else if (elementType == METHOD || elementType == TYPE) {
            hasExclusivelyTypeAndOrMethodTargeting = true;
          }
View Full Code Here

        assertNotNull(meta);

        // Try again (the annotation will be cached). Use an annotation
        // that will not be present.

        Target t = ct.getAnnotation(Target.class);

        assertNull(t);

        verify();
    }
View Full Code Here

                            "annotation with value");
                }
            }
            else if (isInterceptorBindingAnnotation(annotType))
            {
                Target target = clazz.getAnnotation(Target.class);
                ElementType[] type = target.value();

                if (type.length != 1 && !type[0].equals(ElementType.TYPE))
                {
                    throw new WebBeansConfigurationException("Stereotype with @InterceptorBinding must be " +
                            "defined as @Target{TYPE}");
View Full Code Here

        assertNotNull(meta);

        // Try again (the annotations will be cached). Use an annotation
        // that will not be present.

        Target t = ct.getAnnotation(Target.class);

        assertNull(t);

        verify();
    }
View Full Code Here

        assertNotNull(meta);

        // Try again (the annotations will be cached). Use an annotation
        // that will not be present.

        Target t = ct.getAnnotation(Target.class);

        assertNull(t);

        verify();
    }
View Full Code Here

TOP

Related Classes of java.lang.annotation.Target

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.