|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jersey.spi.scanning.AnnotationScannerListener
public class AnnotationScannerListener
A scanner listener that processes Java class files (resource names ending in ".class") annotated with one or more of a set of declared annotations.
Java classes of a Java class file are processed, using ASM, to ascertain if those classes are annotated with one or more of the set of declared annotations.
Such an annotated Java class of a Java class file is loaded if the class is public or is an inner class that is static and public.
Constructor Summary | |
---|---|
AnnotationScannerListener(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
Create a scanner listener to check for annotated Java classes in Java class files. |
|
AnnotationScannerListener(java.lang.ClassLoader classloader,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
Create a scanner listener to check for annotated Java classes in Java class files. |
Method Summary | |
---|---|
java.util.Set<java.lang.Class<?>> |
getAnnotatedClasses()
Get the set of annotated classes. |
boolean |
onAccept(java.lang.String name)
Accept a scanned resource. |
void |
onProcess(java.lang.String name,
java.io.InputStream in)
Process a scanned resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationScannerListener(java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
annotations
- the set of annotation classes to check on Java class
files.public AnnotationScannerListener(java.lang.ClassLoader classloader, java.lang.Class<? extends java.lang.annotation.Annotation>... annotations)
classloader
- the class loader to use to load Java classes that
are annotated with any one of the annotations.annotations
- the set of annotation classes to check on Java class
files.Method Detail |
---|
public java.util.Set<java.lang.Class<?>> getAnnotatedClasses()
public boolean onAccept(java.lang.String name)
ScannerListener
This method will be invoked by a Scanner
to ascertain if the
listener accepts the resource for processing. If acceptable then
the Scanner
will then invoke the
ScannerListener.onProcess(java.lang.String, java.io.InputStream)
method.
onAccept
in interface ScannerListener
name
- the resource name.
public void onProcess(java.lang.String name, java.io.InputStream in) throws java.io.IOException
ScannerListener
This method will be invoked after the listener has accepted the resource.
onProcess
in interface ScannerListener
name
- the resource name.in
- the input stream of the resource
java.io.IOException
- if an error occurs when processing the resource.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |