Package org.jboss.jandex

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


        // The @DependsOn must be on a @Singleton
        final List<AnnotationInstance> singletonAnnotations = annotationsOnBean.get(DotName.createSimple(Singleton.class
                .getName()));
        if (singletonAnnotations == null || singletonAnnotations.isEmpty()) {
            throw new DeploymentUnitProcessingException(
                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
View Full Code Here


        if (singletonAnnotations == null || singletonAnnotations.isEmpty()) {
            throw new DeploymentUnitProcessingException(
                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
        }
    }
View Full Code Here

                    "@DependsOn can appear only on a class annotated with @Singleton. Target: " + dependsOnAnnotation.target()
                            + " is not a class.");
        }
        if (dependsOnAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DependsOn can appear only on a class. Target: "
                    + dependsOnAnnotation.target() + " is not a class.");
        }
    }

    // TODO - This should be externalized to share with EjbResourcesInjectionAnnotationProcessor
    private ServiceName createServiceName(final ComponentDescription componentDescription) {
View Full Code Here

  private AccessType determineClassAccessType(AccessType defaultAccessType) {
    // default to the hierarchy access type to start with
    AccessType accessType = defaultAccessType;

    AnnotationInstance accessAnnotation = JandexHelper.getSingleAnnotation( classInfo, JPADotNames.ACCESS );
    if ( accessAnnotation != null && accessAnnotation.target().getClass().equals( ClassInfo.class ) ) {
      accessType = JandexHelper.getEnumValue( accessAnnotation, "value", AccessType.class );
    }

    return accessType;
  }
View Full Code Here

    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

  private void bindSingleIdAnnotation(EntityBinding entityBinding) {
    AnnotationInstance idAnnotation = JandexHelper.getSingleAnnotation(
        configuredClass.getClassInfo(), JPADotNames.ID
    );

    String idName = JandexHelper.getPropertyName( idAnnotation.target() );
    entityBinding.getEntity().getOrCreateSingularAttribute( idName );
    SimpleAttributeBinding idBinding = entityBinding.makeSimplePrimaryKeyAttributeBinding( idName );

    MappedAttribute idAttribute = configuredClass.getMappedProperty( idName );
View Full Code Here

        }
        if (startupAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @Startup annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance startupAnnotation = startupAnnotations.get(0);
        if (startupAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@Startup can appear only on a class. Target: " + startupAnnotation.target() + " is not a class");
        }
        // mark the component description for init-on-startup
        componentDescription.initOnStartup();
        logger.debug(componentDescription.getEJBName() + " bean has been marked for init-on-startup (a.k.a @Startup)");
View Full Code Here

        if (startupAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @Startup annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance startupAnnotation = startupAnnotations.get(0);
        if (startupAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@Startup can appear only on a class. Target: " + startupAnnotation.target() + " is not a class");
        }
        // mark the component description for init-on-startup
        componentDescription.initOnStartup();
        logger.debug(componentDescription.getEJBName() + " bean has been marked for init-on-startup (a.k.a @Startup)");
    }
View Full Code Here

        }
        if (concurrencyMgmtAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @ConcurrencyManagement annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance concurrencyMgmtAnnotation = concurrencyMgmtAnnotations.get(0);
        if (concurrencyMgmtAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@ConcurrencyManagement can appear only on a class. Target: " + concurrencyMgmtAnnotation.target() + " is not a class");
        }
        AnnotationValue conMgmtAnnVal = concurrencyMgmtAnnotation.value();
        ConcurrencyManagementType concurrencyManagementType = ConcurrencyManagementType.valueOf(conMgmtAnnVal.asEnum());
        switch (concurrencyManagementType) {
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.