congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CompositeIndex
Code IndexAdd Tabnine to your IDE (free)

How to use
CompositeIndex
in
org.jboss.jandex

Best Java code snippets using org.jboss.jandex.CompositeIndex (Showing top 20 results out of 315)

origin: wildfly/jandex

public static CompositeIndex createMerged(final CompositeIndex... indexes) {
  ArrayList<IndexView> list =  new ArrayList<IndexView>();
  for (CompositeIndex index : indexes) {
    list.addAll(index.indexes);
  }
  return create(list);
}
origin: wildfly/jandex

public static CompositeIndex create(Collection<IndexView> indexes) {
  return new CompositeIndex(indexes);
}
origin: weld/core

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: org.wildfly.swarm/container-runtime

protected List<Class<? extends ServerConfiguration>> findServerConfigurationImpls(Module module, List<Index> parentIndexes) throws ModuleLoadException, IOException, NoSuchFieldException, IllegalAccessException {
  List<Index> indexes = new ArrayList<>();
  resolveBuildTimeIndex(module, indexes);
  //resolveRuntimeIndex(module, indexes);
  indexes.addAll(parentIndexes);
  CompositeIndex compositeIndex = CompositeIndex.create(indexes.toArray(new Index[indexes.size()]));
  List<Class<? extends ServerConfiguration>> impls = new ArrayList<>();
  Set<ClassInfo> infos = compositeIndex.getAllKnownImplementors(DotName.createSimple(ServerConfiguration.class.getName()));
  for (ClassInfo info : infos) {
    if (info.name().toString().equals(AnnotationBasedServerConfiguration.class.getName())) {
      continue;
    }
    try {
      Class<? extends ServerConfiguration> cls = (Class<? extends ServerConfiguration>) module.getClassLoader().loadClass(info.name().toString());
      if (!Modifier.isAbstract(cls.getModifiers())) {
        impls.add(cls);
      }
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
  }
  return impls;
}
origin: org.jboss.weld.se/weld-se

private Set<DotName> buildBeanDefiningAnnotationSet(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, CompositeIndex index) {
  ImmutableSet.Builder<DotName> beanDefiningAnnotations = ImmutableSet.builder();
  for (Class<? extends Annotation> annotation : initialBeanDefiningAnnotations) {
    final DotName annotationDotName = DotName.createSimple(annotation.getName());
    if (isMetaAnnotation(annotation)) {
      // find annotations annotated with this meta-annotation
      for (AnnotationInstance instance : index.getAnnotations(annotationDotName)) {
        if (instance.target() instanceof ClassInfo) {
          ClassInfo classInfo = (ClassInfo) instance.target();
          if ((classInfo.flags() & ANNOTATION) != 0) {
            beanDefiningAnnotations.add(classInfo.name());
          }
        }
      }
    } else {
      beanDefiningAnnotations.add(annotationDotName);
    }
  }
  return beanDefiningAnnotations.build();
}
origin: org.jboss.weld.environment/weld-environment-common

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: org.wildfly.swarm/container-runtime

protected List<ServerConfiguration> findAnnotationServerConfigurations(Module apiModule, List<Index> parentIndexes) throws ModuleLoadException, IOException, NoSuchFieldException, IllegalAccessException {
  List<Index> indexes = new ArrayList<>();
  resolveBuildTimeIndex(apiModule, indexes);
  //resolveRuntimeIndex(module, indexes);
  indexes.addAll(parentIndexes);
  CompositeIndex compositeIndex = CompositeIndex.create(indexes.toArray(new Index[indexes.size()]));
  List<ServerConfiguration> impls = new ArrayList<>();
  DotName configAnno = DotName.createSimple(Configuration.class.getName());
  Set<ClassInfo> infos = compositeIndex.getAllKnownImplementors(DotName.createSimple(Fraction.class.getName()));
  for (ClassInfo info : infos) {
    for (AnnotationInstance anno : info.classAnnotations()) {
      if (anno.name().equals(configAnno)) {
        try {
          ServerConfiguration config = fromAnnotation(apiModule, anno);
          impls.add(config);
        } catch (ClassNotFoundException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return impls;
}
origin: weld/core

private Set<DotName> buildBeanDefiningAnnotationSet(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, CompositeIndex index) {
  ImmutableSet.Builder<DotName> beanDefiningAnnotations = ImmutableSet.builder();
  for (Class<? extends Annotation> annotation : initialBeanDefiningAnnotations) {
    final DotName annotationDotName = DotName.createSimple(annotation.getName());
    if (isMetaAnnotation(annotation)) {
      // find annotations annotated with this meta-annotation
      for (AnnotationInstance instance : index.getAnnotations(annotationDotName)) {
        if (instance.target() instanceof ClassInfo) {
          ClassInfo classInfo = instance.target().asClass();
          if ((classInfo.flags() & ANNOTATION) != 0) {
            beanDefiningAnnotations.add(classInfo.name());
          }
        }
      }
    } else {
      beanDefiningAnnotations.add(annotationDotName);
    }
  }
  return beanDefiningAnnotations.build();
}
origin: thorntail/thorntail

IndexView createDeploymentIndex(Archive<?> deployment) {
  List<IndexView> indexes = new ArrayList<IndexView>();
  try {
    index(deployment, indexes);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  return CompositeIndex.create(indexes);
}
origin: org.jboss.weld.se/weld-se

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: weld/core

private Set<DotName> buildBeanDefiningAnnotationSet(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, CompositeIndex index) {
  ImmutableSet.Builder<DotName> beanDefiningAnnotations = ImmutableSet.builder();
  for (Class<? extends Annotation> annotation : initialBeanDefiningAnnotations) {
    final DotName annotationDotName = DotName.createSimple(annotation.getName());
    if (isMetaAnnotation(annotation)) {
      // find annotations annotated with this meta-annotation
      for (AnnotationInstance instance : index.getAnnotations(annotationDotName)) {
        if (instance.target() instanceof ClassInfo) {
          ClassInfo classInfo = instance.target().asClass();
          if ((classInfo.flags() & ANNOTATION) != 0) {
            beanDefiningAnnotations.add(classInfo.name());
          }
        }
      }
    } else {
      beanDefiningAnnotations.add(annotationDotName);
    }
  }
  return beanDefiningAnnotations.build();
}
origin: wildfly/jandex

public static CompositeIndex create(final IndexView... indexes) {
  return new CompositeIndex(Arrays.asList(indexes));
}
origin: org.wildfly.swarm/container

IndexView createDeploymentIndex(Archive<?> deployment) {
  List<IndexView> indexes = new ArrayList<IndexView>();
  try {
    index(deployment, indexes);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  return CompositeIndex.create(indexes);
}
origin: weld/core

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: weld/core

private Set<DotName> buildBeanDefiningAnnotationSet(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, CompositeIndex index) {
  ImmutableSet.Builder<DotName> beanDefiningAnnotations = ImmutableSet.builder();
  for (Class<? extends Annotation> annotation : initialBeanDefiningAnnotations) {
    final DotName annotationDotName = DotName.createSimple(annotation.getName());
    if (isMetaAnnotation(annotation)) {
      // find annotations annotated with this meta-annotation
      for (AnnotationInstance instance : index.getAnnotations(annotationDotName)) {
        if (instance.target() instanceof ClassInfo) {
          ClassInfo classInfo = instance.target().asClass();
          if ((classInfo.flags() & ANNOTATION) != 0) {
            beanDefiningAnnotations.add(classInfo.name());
          }
        }
      }
    } else {
      beanDefiningAnnotations.add(annotationDotName);
    }
  }
  return beanDefiningAnnotations.build();
}
origin: io.thorntail/container

IndexView createDeploymentIndex(Archive<?> deployment) {
  List<IndexView> indexes = new ArrayList<IndexView>();
  try {
    index(deployment, indexes);
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
  return CompositeIndex.create(indexes);
}
origin: weld/core

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
origin: org.jboss.weld.environment/weld-environment-common

private Set<DotName> buildBeanDefiningAnnotationSet(Set<Class<? extends Annotation>> initialBeanDefiningAnnotations, CompositeIndex index) {
  ImmutableSet.Builder<DotName> beanDefiningAnnotations = ImmutableSet.builder();
  for (Class<? extends Annotation> annotation : initialBeanDefiningAnnotations) {
    final DotName annotationDotName = DotName.createSimple(annotation.getName());
    if (isMetaAnnotation(annotation)) {
      // find annotations annotated with this meta-annotation
      for (AnnotationInstance instance : index.getAnnotations(annotationDotName)) {
        if (instance.target() instanceof ClassInfo) {
          ClassInfo classInfo = instance.target().asClass();
          if ((classInfo.flags() & ANNOTATION) != 0) {
            beanDefiningAnnotations.add(classInfo.name());
          }
        }
      }
    } else {
      beanDefiningAnnotations.add(annotationDotName);
    }
  }
  return beanDefiningAnnotations.build();
}
origin: weld/core

@Override
protected void beforeDiscovery(Collection<BeanArchiveBuilder> builders) {
  List<IndexView> indexes = new ArrayList<IndexView>();
  for (BeanArchiveBuilder builder : builders) {
    IndexView index = (IndexView) builder.getAttribute(Jandex.INDEX_ATTRIBUTE_NAME);
    if (index != null) {
      indexes.add(index);
    }
  }
  cindex = CompositeIndex.create(indexes);
  beanDefiningAnnotations = buildBeanDefiningAnnotationSet(initialBeanDefiningAnnotations, cindex);
  classFileServices = new JandexClassFileServices(this);
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

private boolean containsBeanDefiningAnnotation(ClassInfo cinfo, String className) {
  for (Entry<DotName, List<AnnotationInstance>> entry : cinfo.annotations().entrySet()) {
    if (beanDefiningAnnotations.contains(entry.getKey())) {
      return true;
    }
    if (isDeclaredOnBeanClass(entry, cinfo) && cindex.getClassByName(entry.getKey()) == null) {
      // Annotation not found in the composite index - falling back to reflection
      Class<?> clazz = Reflections.loadClass(resourceLoader, className);
      if (clazz != null) {
        for (Class<? extends Annotation> metaAnnotation : Reflections.META_ANNOTATIONS) {
          if (hasBeanDefiningMetaAnnotationSpecified(clazz.getAnnotations(), metaAnnotation)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
org.jboss.jandexCompositeIndex

Javadoc

Composite annotation index. Represents an aggregation of multiple Index instances. An example application is a Java EE deployment, which can contain multiple nested jars, each with their own index.

Most used methods

  • create
  • getAnnotations
  • getClassByName
  • <init>
  • getAllKnownImplementors
  • getAllKnownSubClasses
  • getKnownImplementors

Popular in Java

  • Reading from database using SQL prepared statement
  • getSystemService (Context)
  • findViewById (Activity)
  • addToBackStack (FragmentTransaction)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now