org.apache.lucene.util

## Class SPIClassIterator<S>

- java.lang.Object
- - org.apache.lucene.util.SPIClassIterator<S>

All Implemented Interfaces:
  Iterator<Class<? extends S>>

    public final class SPIClassIterator<S>
    extends Object
    implements Iterator<Class<? extends S>>

Helper class for loading SPI classes from classpath (META-INF files). This is a light impl of `ServiceLoader` but is guaranteed to be bug-free regarding classpath order and does not instantiate or initialize the classes found.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

### Method Summary

Methods
`static <S> SPIClassIterator<S>` `get(Class<S> clazz)`
`static <S> SPIClassIterator<S>` `get(Class<S> clazz, ClassLoader loader)`
`boolean` `hasNext()`
`Class<? extends S>` `next()`
`void` `remove()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### get

    public static <S> SPIClassIterator<S> get(Class<S> clazz)

#### get

    public static <S> SPIClassIterator<S> get(Class<S> clazz,
                              ClassLoader loader)

#### hasNext

    public boolean hasNext()

Specified by:
  `hasNext` in interface `Iterator<Class<? extends S>>`

#### next

    public Class<? extends S> next()

Specified by:
  `next` in interface `Iterator<Class<? extends S>>`

#### remove

    public void remove()

Specified by:
  `remove` in interface `Iterator<Class<? extends S>>`