Пример #1
0
  private void introspectInjectClass(
      AnnotatedType<X> type, ArrayList<ConfigProgram> injectProgramList) {
    InjectManager cdiManager = getBeanManager();

    for (Annotation ann : type.getAnnotations()) {
      Class<? extends Annotation> annType = ann.annotationType();

      InjectionPointHandler handler = cdiManager.getInjectionPointHandler(annType);

      if (handler != null) {
        injectProgramList.add(new ClassHandlerProgram(ann, handler));
      }
    }

    // ioc/123i
    for (Class<?> parentClass = type.getJavaClass().getSuperclass();
        parentClass != null;
        parentClass = parentClass.getSuperclass()) {
      for (Annotation ann : parentClass.getAnnotations()) {
        Class<? extends Annotation> annType = ann.annotationType();

        InjectionPointHandler handler = cdiManager.getInjectionPointHandler(annType);

        if (handler != null) {
          injectProgramList.add(new ClassHandlerProgram(ann, handler));
        }
      }
    }
  }