Package org.jboss.jandex

Examples of org.jboss.jandex.ClassInfo


    // todo : this needs to tie into the metamodel branch...
    MetadataSources metadataSources = new MetadataSources();

    for ( ClassDescriptor classDescriptor : deploymentResources.getClassDescriptors() ) {
      final String className = classDescriptor.getName();
      final ClassInfo classInfo = jandexIndex.getClassByName( DotName.createSimple( className ) );
      if ( classInfo == null ) {
        // Not really sure what this means.  Most likely it is explicitly listed in the persistence unit,
        // but mapped via mapping file.  Anyway assume its a mapping class...
        metadataSources.annotatedMappingClassNames.add( className );
        continue;
      }

      // logic here assumes an entity is not also a converter...
      AnnotationInstance converterAnnotation = JandexHelper.getSingleAnnotation(
          classInfo.annotations(),
          JPADotNames.CONVERTER
      );
      if ( converterAnnotation != null ) {
        metadataSources.converterDescriptors.add(
            new MetadataSources.ConverterDescriptor(
View Full Code Here


    return callbackClassList;
  }

  private void processDefaultJpaCallbacks(String instanceCallbackClassName, List<JpaCallbackClass> jpaCallbackClassList) {
    ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

    // Process superclass first if available and not excluded
    if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
      DotName superName = callbackClassInfo.superName();
      if ( superName != null ) {
        processDefaultJpaCallbacks( instanceCallbackClassName, jpaCallbackClassList );
      }
    }

    String callbackClassName = callbackClassInfo.name().toString();
    Map<Class<?>, String> callbacksByType = new HashMap<Class<?>, String>();
    createDefaultCallback(
        PrePersist.class, PseudoJpaDotNames.DEFAULT_PRE_PERSIST, callbackClassName, callbacksByType
    );
    createDefaultCallback(
View Full Code Here

    }
  }

  private void processJpaCallbacks(String instanceCallbackClassName, boolean isListener, List<JpaCallbackClass> callbackClassList) {

    ClassInfo callbackClassInfo = getLocalBindingContext().getClassInfo( instanceCallbackClassName );

    // Process superclass first if available and not excluded
    if ( JandexHelper.getSingleAnnotation( callbackClassInfo, JPADotNames.EXCLUDE_SUPERCLASS_LISTENERS ) != null ) {
      DotName superName = callbackClassInfo.superName();
      if ( superName != null ) {
        processJpaCallbacks(
            instanceCallbackClassName,
            isListener,
            callbackClassList
View Full Code Here

   *
   * @return a set of {@code ConfiguredClassHierarchy}s. One for each "leaf" entity.
   */
  public static EmbeddableHierarchy createEmbeddableHierarchy(Class<?> embeddableClass, String propertyName, AccessType accessType, AnnotationBindingContext context) {

    ClassInfo embeddableClassInfo = context.getClassInfo( embeddableClass.getName() );
    if ( embeddableClassInfo == null ) {
      throw new AssertionFailure(
          String.format(
              "The specified class %s cannot be found in the annotation index",
              embeddableClass.getName()
          )
      );
    }

    if ( JandexHelper.getSingleAnnotation( embeddableClassInfo, JPADotNames.EMBEDDABLE ) == null ) {
      throw new AssertionFailure(
          String.format(
              "The specified class %s is not annotated with @Embeddable even though it is as embeddable",
              embeddableClass.getName()
          )
      );
    }

    List<ClassInfo> classInfoList = new ArrayList<ClassInfo>();
    ClassInfo tmpClassInfo;
    Class<?> clazz = embeddableClass;
    while ( clazz != null && !clazz.equals( Object.class ) ) {
      tmpClassInfo = context.getIndex().getClassByName( DotName.createSimple( clazz.getName() ) );
      clazz = clazz.getSuperclass();
      if ( tmpClassInfo == null ) {
View Full Code Here

        for (Map.Entry<URL, Index> entry : pu.getAnnotationIndex().entrySet()) {
            List<AnnotationInstance> instances = entry.getValue().getAnnotations(DotName.createSimple(Entity.class.getName()));
            for (AnnotationInstance instance : instances) {
                AnnotationTarget target = instance.target();
                if (target instanceof ClassInfo) {
                    ClassInfo classInfo = (ClassInfo) target;
                    persistenceTypeNames.add(classInfo.name().toString());
                }
            }
        }
        synchronized (CACHED_TYPENAMES) {
            CACHED_TYPENAMES.put(pu, persistenceTypeNames);
View Full Code Here

            String declaringClass = f.declaringClass().name().toString();
            annotation = new AnnotationImpl(declaringClass, cl, null, f.name(), false, true, annotationClass);
         }
         else if (target instanceof ClassInfo)
         {
            ClassInfo c = (ClassInfo) target;
            annotation = new AnnotationImpl(c.name().toString(), cl, null, null, false, false, annotationClass);
         }
         if (annotation != null)
         {
            annotations.add(annotation);
         }
View Full Code Here

                FieldInfo f = (FieldInfo) target;
                String declaringClass = f.declaringClass().name().toString();
                annotation = new AnnotationImpl(declaringClass, cl, null, f.name(), false, true, annotationClass);
            }
            if (target instanceof ClassInfo) {
                ClassInfo c = (ClassInfo) target;
                annotation = new AnnotationImpl(c.name().toString(), cl, null, null, false, false, annotationClass);
            }
            if (annotation != null) {
                annotations.add(annotation);
            }
        }
View Full Code Here

        for (AnnotationInstance instance : instances) {
            AnnotationTarget target = instance.target();
            if (!(target instanceof ClassInfo)) {
                throw MESSAGES.classOnlyAnnotation("@ManagedBean", target);
            }
            final ClassInfo classInfo = (ClassInfo) target;
            // skip if it's not a valid managed bean class
            if (!assertManagedBeanClassValidity(classInfo)) {
                continue;
            }
            final String beanClassName = classInfo.name().toString();

            // Get the managed bean name from the annotation
            final AnnotationValue nameValue = instance.value();
            final String beanName = nameValue == null || nameValue.asString().isEmpty() ? beanClassName : nameValue.asString();
            final ComponentDescription componentDescription = new ComponentDescription(beanName, beanClassName, moduleDescription, deploymentUnit.getServiceName());
View Full Code Here

        final EEModuleDescription moduleDescription = getRequiredAttachment(unit, EE_MODULE_DESCRIPTION);
        final JAXWSDeployment jaxwsDeployment = getJaxwsDeployment(unit);

        for (final AnnotationInstance webServiceAnnotation : webServiceAnnotations) {
            final AnnotationTarget target = webServiceAnnotation.target();
            final ClassInfo webServiceClassInfo = (ClassInfo) target;
            final String webServiceClassName = webServiceClassInfo.name().toString();
            final List<ComponentDescription> componentDescriptions = moduleDescription.getComponentsByClassName(webServiceClassName);
            final List<SessionBeanComponentDescription> sessionBeans = getSessionBeans(componentDescriptions);
            final Set<String> securityRoles = getSecurityRoles(unit, webServiceClassInfo); // TODO: assembly processed for each endpoint!
            final WebContextAnnotationWrapper webCtx = getWebContextWrapper(webServiceClassInfo);
            final String authMethod = webCtx.getAuthMethod();
View Full Code Here

        for (final AnnotationInstance handlerChainAnnotation : handlerChainAnnotations) {
            final AnnotationTarget annotationTarget = handlerChainAnnotation.target();

            if (annotationTarget instanceof ClassInfo) {
                final ClassInfo classInfo = (ClassInfo) annotationTarget;
                if (isJaxwsEndpoint(classInfo, index)) {
                    final String endpointClass = classInfo.name().toString();
                    processHandlerChainAnnotation(resourceRoot, handlerChainAnnotation, endpointClass, mapping);
                }
            } else {
                // We ignore fields & methods annotated with @HandlerChain.
                // These are used always in combination with @WebServiceRef
View Full Code Here

TOP

Related Classes of org.jboss.jandex.ClassInfo

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.