Package org.apache.lucene.util
Class SPIClassIterator<S>
- java.lang.Object
-
- org.apache.lucene.util.SPIClassIterator<S>
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.Class<? extends S>>
public final class SPIClassIterator<S> extends java.lang.Object implements java.util.Iterator<java.lang.Class<? extends S>>
Helper class for loading SPI classes from classpath (META-INF files). This is a light impl ofServiceLoader
but is guaranteed to be bug-free regarding classpath order and does not instantiate or initialize the classes found.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <S> SPIClassIterator<S>
get(java.lang.Class<S> clazz)
static <S> SPIClassIterator<S>
get(java.lang.Class<S> clazz, java.lang.ClassLoader loader)
boolean
hasNext()
static boolean
isParentClassLoader(java.lang.ClassLoader parent, java.lang.ClassLoader child)
Utility method to check if some class loader is a (grand-)parent of or the same as another one.java.lang.Class<? extends S>
next()
void
remove()
-
-
-
Method Detail
-
get
public static <S> SPIClassIterator<S> get(java.lang.Class<S> clazz)
-
get
public static <S> SPIClassIterator<S> get(java.lang.Class<S> clazz, java.lang.ClassLoader loader)
-
isParentClassLoader
public static boolean isParentClassLoader(java.lang.ClassLoader parent, java.lang.ClassLoader child)
Utility method to check if some class loader is a (grand-)parent of or the same as another one. This means the child will be able to load all classes from the parent, too.
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<S>
-
next
public java.lang.Class<? extends S> next()
- Specified by:
next
in interfacejava.util.Iterator<S>
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<S>
-
-