Package org.jboss.jandex

Examples of org.jboss.jandex.AnnotationInstance.target()


    AnnotationInstance attributeOverrideAnnotation = JandexHelper.getSingleAnnotation(
        classInfo,
        JPADotNames.ATTRIBUTE_OVERRIDE
    );
    if ( attributeOverrideAnnotation != null ) {
      String prefix = createPathPrefix( attributeOverrideAnnotation.target() );
      AttributeOverride override = new AttributeOverride( prefix, attributeOverrideAnnotation );
      attributeOverrideList.put( override.getAttributePath(), override );
    }

    AnnotationInstance attributeOverridesAnnotation = JandexHelper.getSingleAnnotation(
View Full Code Here


        JPADotNames.ATTRIBUTE_OVERRIDES
    );
    if ( attributeOverridesAnnotation != null ) {
      AnnotationInstance[] annotationInstances = attributeOverridesAnnotation.value().asNestedArray();
      for ( AnnotationInstance annotationInstance : annotationInstances ) {
        String prefix = createPathPrefix( attributeOverridesAnnotation.target() );
        AttributeOverride override = new AttributeOverride( prefix, annotationInstance );
        attributeOverrideList.put( override.getAttributePath(), override );
      }
    }
    return attributeOverrideList;
View Full Code Here

  protected void process(DotName annName, AnnotationInstance annotationInstance, List<AnnotationInstance> indexedAnnotationInstanceList) {
    AnnotationTarget target = annotationInstance.target();

    for ( Iterator<AnnotationInstance> iter = indexedAnnotationInstanceList.iterator(); iter.hasNext(); ) {
      AnnotationInstance ann = iter.next();
      if ( MockHelper.targetEquals( target, ann.target() ) ) {
        iter.remove();
      }
    }
  }
View Full Code Here

        case ATTRIBUTE:
          List<AnnotationInstance> indexedAnnotationInstanceList = map.get( entityAnnName );
          Iterator<AnnotationInstance> iter = indexedAnnotationInstanceList.iterator();
          while ( iter.hasNext() ) {
            AnnotationInstance ann = iter.next();
            if ( MockHelper.targetEquals( target, ann.target() ) ) {
              iter.remove();
            }
          }
          break;
      }
View Full Code Here

            return Collections.emptyList();
        }

        final AnnotationInstance annotationInstance = annotations.get(0);
        final AnnotationInstance[] resourceAnnotations = annotationInstance.value().asNestedArray();
        final ClassInfo classInfo = ClassInfo.class.cast(annotationInstance.target());
        final List<BindingDescription> resourceConfigurations = new ArrayList<BindingDescription>(resourceAnnotations.length);
        for (AnnotationInstance resource : resourceAnnotations) {
            resourceConfigurations.add(processClass(resource, classInfo, vfs, duModule, index));
        }
        return resourceConfigurations;
View Full Code Here

        }

        // process @PermitAll annotation
        if (webServiceClassInfo.annotations().containsKey(PERMIT_ALL_ANNOTATION)) {
            final AnnotationInstance permitAll = webServiceClassInfo.annotations().get(PERMIT_ALL_ANNOTATION).iterator().next();
            if (permitAll.target().equals(webServiceClassInfo)) {
                securityRoles.add("*");
            }
        }

        return (securityRoles.size() > 0) ? Collections.unmodifiableSet(securityRoles) : Collections.<String>emptySet();
View Full Code Here

        if (annotations.size() > 1) {
            throw new DeploymentUnitProcessingException("@" + annotationType + " appears more than once in EJB class: " + sessionBeanClass.name());
        }

        final AnnotationInstance annotation = annotations.get(0);
        final AnnotationTarget target = annotation.target();
        if (target instanceof ClassInfo == false) {
            throw new RuntimeException("@" + annotationType + " should only appear on a class. Target: " + target + " is not a class");
        }
        AnnotationValue annotationValue = annotation.value();
        if (annotationValue == null) {
View Full Code Here

            return Collections.emptyList();
        }

        final AnnotationInstance annotationInstance = annotations.get(0);
        final AnnotationInstance[] resourceAnnotations = annotationInstance.value().asNestedArray();
        final ClassInfo classInfo = ClassInfo.class.cast(annotationInstance.target());
        final List<BindingDescription> resourceConfigurations = new ArrayList<BindingDescription>(resourceAnnotations.length);
        for (AnnotationInstance resource : resourceAnnotations) {
            resourceConfigurations.add(processClass(resource, classInfo, vfs, duModule, index));
        }
        return resourceConfigurations;
View Full Code Here

  private void bindEmbeddedIdAnnotation(EntityBinding entityBinding) {
    AnnotationInstance idAnnotation = JandexHelper.getSingleAnnotation(
        entityClass.getClassInfo(), JPADotNames.EMBEDDED_ID
    );

    String idName = JandexHelper.getPropertyName( idAnnotation.target() );
    MappedAttribute idAttribute = entityClass.getMappedAttribute( idName );
    if ( !( idAttribute instanceof SimpleAttribute ) ) {
      throw new AssertionFailure( "Unexpected attribute type for id attribute" );
    }
View Full Code Here

    );
    if ( generatedValueAnn == null ) {
      return;
    }

    String idName = JandexHelper.getPropertyName( generatedValueAnn.target() );
    if ( !idPropertyName.equals( idName ) ) {
      throw new AssertionFailure(
          String.format(
              "Attribute[%s.%s] with @GeneratedValue doesn't have a @Id.",
              entityClass.getName(),
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.