Examples of annotations()


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

        }
        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;
        }
        return null;
    }
View Full Code Here

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

            // fallback to using reflection
            return Reflections.containsAnnotation(originalClass, requiredAnnotation);
        }

        // type and members
        if (clazz.annotations().containsKey(requiredAnnotationName)) {
            return true;
        }
        // meta-annotations
        for (DotName annotation : clazz.annotations().keySet()) {
            ClassInfo annotationClassInfo = index.getClassByName(annotation);
View Full Code Here

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

        // type and members
        if (clazz.annotations().containsKey(requiredAnnotationName)) {
            return true;
        }
        // meta-annotations
        for (DotName annotation : clazz.annotations().keySet()) {
            ClassInfo annotationClassInfo = index.getClassByName(annotation);
            if (annotationClassInfo != null) {
                if (annotationClassInfo.annotations().containsKey(requiredAnnotationName)) {
                    return true;
                }
View Full Code Here

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

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

            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

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

            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

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

            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

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

        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

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

  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

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

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