Package org.jboss.jandex

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


        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) {
            case CONTAINER:
View Full Code Here


        }
        if (declareRolesAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @DeclareRoles annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance declareRolesAnnotation = declareRolesAnnotations.get(0);
        if (declareRolesAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DeclareRoles can appear only on a class. Target: " + declareRolesAnnotation.target() + " is not a class");
        }
        final AnnotationValue annotationValue = declareRolesAnnotation.value();
        final String[] roles = annotationValue.asStringArray();
        if (roles != null) {
View Full Code Here

        if (declareRolesAnnotations.size() > 1) {
            throw new DeploymentUnitProcessingException("More than one @DeclareRoles annotation found on bean: " + componentDescription.getEJBName());
        }
        AnnotationInstance declareRolesAnnotation = declareRolesAnnotations.get(0);
        if (declareRolesAnnotation.target() instanceof ClassInfo == false) {
            throw new DeploymentUnitProcessingException("@DeclareRoles can appear only on a class. Target: " + declareRolesAnnotation.target() + " is not a class");
        }
        final AnnotationValue annotationValue = declareRolesAnnotation.value();
        final String[] roles = annotationValue.asStringArray();
        if (roles != null) {
            // add the declared roles
View Full Code Here

        // 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

        }

        // 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

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

    String idName = JandexHelper.getPropertyName( idAnnotation.target() );
    MappedAttribute idAttribute = configuredClass.getMappedProperty( 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.",
              configuredClass.getName(),
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

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.