Package org.jboss.jandex

Examples of org.jboss.jandex.ClassInfo.annotations()


        }
        // meta-annotations
        for (DotName annotation : clazz.annotations().keySet()) {
            ClassInfo annotationClassInfo = index.getClassByName(annotation);
            if (annotationClassInfo != null) {
                if (annotationClassInfo.annotations().containsKey(requiredAnnotationName)) {
                    return true;
                }
            } else {
                // the annotation is not indexed, let's try to load the class and inspect using reflection
                Class<?> annotationClass;
View Full Code Here


            for (AnnotationInstance instance : index.getAnnotations(DotName.createSimple(key.getName()))) {
                AnnotationTarget target = instance.target();
                if (target instanceof ClassInfo) {
                    ClassInfo clazz = (ClassInfo) target;
                    if (Indices.isAnnotation(clazz)) {
                        builder.add(new AnnotationType(clazz.name(), clazz.annotations().containsKey(INHERITED_NAME)));
                    }
                }
            }
            return builder.build();
        }
View Full Code Here

            ClassInfo annotationClassInfo = index.getClassByName(name);
            ImmutableSet.Builder<String> builder = ImmutableSet.builder();

            if (annotationClassInfo != null) {
                for (DotName annotationName : annotationClassInfo.annotations().keySet()) {
                    builder.add(annotationName.toString());
                }
            } else {
                try {
                     Class<?> annotationClass = moduleClassLoader.loadClass(name.toString());
View Full Code Here

            throw EeLogger.ROOT_LOGGER.methodOnlyAnnotation(AROUND_INVOKE_ANNOTATION_NAME);
        }
        final MethodInfo methodInfo = MethodInfo.class.cast(target);
        final ClassInfo classInfo = methodInfo.declaringClass();
        final EEModuleClassDescription classDescription = eeModuleDescription.addOrGetLocalClassDescription(classInfo.name().toString());
        final List<AnnotationInstance> classAroundInvokes = classInfo.annotations().get(AROUND_INVOKE_ANNOTATION_NAME);
        if(classAroundInvokes.size() > 1) {
           throw EeLogger.ROOT_LOGGER.aroundInvokeAnnotationUsedTooManyTimes(classInfo.name(), classAroundInvokes.size());
        }
        validateArgumentType(classInfo, methodInfo);
        InterceptorClassDescription.Builder builder = InterceptorClassDescription.builder(classDescription.getInterceptorClassDescription());
View Full Code Here

        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

  public Map<DotName, List<AnnotationInstance>> getIndexedAnnotations(DotName name) {
    Map<DotName, List<AnnotationInstance>> map = indexedClassInfoAnnotationsMap.get( name );
    if ( map == null ) {
      ClassInfo ci = index.getClassByName( name );
      if ( ci == null || ci.annotations() == null ) {
        map = Collections.emptyMap();
      }
      else {
        map = new HashMap<DotName, List<AnnotationInstance>>( ci.annotations() );
        //here we ignore global annotations
View Full Code Here

      ClassInfo ci = index.getClassByName( name );
      if ( ci == null || ci.annotations() == null ) {
        map = Collections.emptyMap();
      }
      else {
        map = new HashMap<DotName, List<AnnotationInstance>>( ci.annotations() );
        //here we ignore global annotations
        for ( DotName globalAnnotationName : DefaultConfigurationHelper.GLOBAL_ANNOTATIONS ) {
          if ( map.containsKey( globalAnnotationName ) ) {
            map.put( globalAnnotationName, Collections.<AnnotationInstance>emptyList() );
          }
View Full Code Here

        Set<String> localInterfaces = new HashSet<String>();
        for(DotName iface : interfaces) {
            final ClassInfo ifaceClass = compositeIndex.getClassByName(iface);

            if(ifaceClass != null) {
                final List<AnnotationInstance> annotations = ifaceClass.annotations().get(annotationType);
                if(annotations != null) {
                    for(AnnotationInstance annotation : annotations) {
                        if(annotation.target() instanceof ClassInfo) {
                            localInterfaces.add(iface.toString());
                            break;
View Full Code Here

        final ClassInfo classInfo = index.getClassByName(iface);
        if(classInfo == null) {
            logger.warnf("Could not read annotations in interface %s when determining local interfaces for %s",iface, sessionBeanClass.name());
            return null;
        }
        List<AnnotationInstance> annotations = classInfo.annotations().get(REMOTE);
        if(annotations == null || annotations.isEmpty()) {
            return iface.toString();
        }
        for(AnnotationInstance annotation : annotations) {
            if(annotation.target() instanceof ClassInfo) {
View Full Code Here

    private SessionType determineSessionType(final String ejbClass, final CompositeIndex compositeIndex) {
        if(ejbClass == null) {
            return null;
        }
        final ClassInfo info = compositeIndex.getClassByName(DotName.createSimple(ejbClass));
        if(info.annotations().get(STATEFUL_ANNOTATION) != null) {
            return SessionType.Stateful;
        } else if(info.annotations().get(STATELESS_ANNOTATION) != null) {
            return SessionType.Stateless;
        } else if(info.annotations().get(SINGLETON_ANNOTATION) != null) {
            return SessionType.Singleton;
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.