java.lang.Object
javax.ide.spi.LookupProvider
- public final class LookupProvider
- extends java.lang.Object
Provides facilities for looking up implementation classes.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LookupProvider
private LookupProvider()
lookup
public static java.lang.Object lookup(java.lang.ClassLoader loader,
java.lang.Class clazz)
throws ProviderNotFoundException
- Look up and create the an implementation of a specified
class.
The implementation class is stored on a jar in the classpath in the
META-INF/services/some.class.Name file. This file contains the fully
qualified name of the implementation class of some.class.Name.
If there are multiple META-INF/services/some.class.Name files on the
classpath, the last one wins. This is intentionally different
from the normal classpath precendence order so that it is possible to
override a more general implementation (e.g. a JSR-198 default
implementation of some service) with a specific one (e.g. an IDE
specific service).
lookupAll
public static java.util.Collection lookupAll(java.lang.ClassLoader loader,
java.lang.Class clazz)
throws ProviderNotFoundException
- Look up and create all available implementations of a specified class.
The implementation class is stored on a jar in the classpath in the
META-INF/services/some.class.Name file. This file contains the fully
qualified name of the implementation class of some.class.Name.