|
Lombok - v0.9.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlombok.core.SpiLoadUtil
public class SpiLoadUtil
The java core libraries have a SPI discovery system, but it works only in Java 1.6 and up. For at least Eclipse,
lombok actually works in java 1.5, so we've rolled our own SPI discovery system.
It is not API compatible with ServiceLoader.
ServiceLoader| Method Summary | ||
|---|---|---|
static java.lang.Class<? extends java.lang.annotation.Annotation> |
findAnnotationClass(java.lang.Class<?> c,
java.lang.Class<?> base)
This method will find the @{code T} in public class Foo extends BaseType<T>. |
|
static
|
findServices(java.lang.Class<C> target)
Returns an iterator of instances that, at least according to the spi discovery file, are implementations of the stated class. |
|
static
|
findServices(java.lang.Class<C> target,
java.lang.ClassLoader loader)
Returns an iterator of class objects that, at least according to the spi discovery file, are implementations of the stated class. |
|
static
|
readAllFromIterator(java.lang.Iterable<T> findServices)
Method that conveniently turn the Iterables returned by the other methods in this class to a
List. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> java.util.List<T> readAllFromIterator(java.lang.Iterable<T> findServices)
Iterables returned by the other methods in this class to a
List.
findServices(Class),
findServices(Class, ClassLoader)
public static <C> java.lang.Iterable<C> findServices(java.lang.Class<C> target)
throws java.io.IOException
findServices(Class, ClassLoader) method with
this Thread's context class loader as ClassLoader.
target - class to find implementations for.
java.io.IOException
public static <C> java.lang.Iterable<C> findServices(java.lang.Class<C> target,
java.lang.ClassLoader loader)
throws java.io.IOException
target - class to find implementations for.loader - The classloader object to use to both the spi discovery files, as well as the loader to use
to make the returned instances.
java.io.IOException
public static java.lang.Class<? extends java.lang.annotation.Annotation> findAnnotationClass(java.lang.Class<?> c,
java.lang.Class<?> base)
public class Foo extends BaseType<T>.
It returns an annotation type because it is used exclusively to figure out which annotations are
being handled by EclipseAnnotationHandler and JavacAnnotationHandler.
|
Lombok - v0.9.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||