Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.spi
Class LookupProvider  view LookupProvider download LookupProvider.java

java.lang.Object
  extended byjavax.ide.spi.LookupProvider

public final class LookupProvider
extends java.lang.Object

Provides facilities for looking up implementation classes.


Constructor Summary
private LookupProvider()
           
 
Method Summary
static java.lang.Object lookup(java.lang.ClassLoader loader, java.lang.Class clazz)
          Look up and create the an implementation of a specified class.
static java.util.Collection lookupAll(java.lang.ClassLoader loader, java.lang.Class clazz)
          Look up and create all available implementations of a specified class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupProvider

private LookupProvider()
Method Detail

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.