org.springframework.boot.context.annotation

Class ImportCandidates

  • java.lang.Object
    • org.springframework.boot.context.annotation.ImportCandidates
  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>


    public final class ImportCandidates
    extends java.lang.Object
    implements java.lang.Iterable<java.lang.String>
    Contains @Configuration import candidates, usually auto-configurations. The load(Class, ClassLoader) method can be used to discover the import candidates.
    Since:
    2.7.0
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Iterator<java.lang.String> iterator() 
      static ImportCandidates load(java.lang.Class<?> annotation, java.lang.ClassLoader classLoader)
      Loads the names of import candidates from the classpath.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
      • load

        public static ImportCandidates load(java.lang.Class<?> annotation,
                                            java.lang.ClassLoader classLoader)
        Loads the names of import candidates from the classpath. The names of the import candidates are stored in files named META-INF/spring/full-qualified-annotation-name.imports on the classpath. Every line contains the full qualified name of the candidate class. Comments are supported using the # character.
        Parameters:
        annotation - annotation to load
        classLoader - class loader to use for loading
        Returns:
        list of names of annotated classes