org.eclipse.jetty.annotations
Class AnnotationFinder

java.lang.Object
  extended by org.eclipse.jetty.annotations.AnnotationFinder

public class AnnotationFinder
extends Object

AnnotationFinder Scans class sources using asm to find annotations.


Nested Class Summary
static class AnnotationFinder.AnnotatedStructure
          AnnotatedStructure Annotations on an object such as a class, field or method.
 class AnnotationFinder.MyClassVisitor
          MyClassVisitor ASM visitor for a class.
static class AnnotationFinder.ParsedClass
          ParsedClass A class that contains annotations.
static class AnnotationFinder.ParsedField
          ParsedField A class field that can contain annotations.
static class AnnotationFinder.ParsedMethod
          ParsedMethod A class method that can contain annotations.
 
Constructor Summary
AnnotationFinder()
           
 
Method Summary
static Class convertType(org.objectweb.asm.Type t)
           
static Class[] convertTypes(org.objectweb.asm.Type[] types)
           
protected  boolean excludeClass(String name)
          Exclude class by name Instances of AnnotationFinder can implement this method to exclude classes by name.
 void find(ClassLoader loader, boolean visitParents, boolean nullInclusive, ClassNameResolver resolver)
          Find annotations on classes in the supplied classloader.
 void find(List<String> classNames, ClassNameResolver resolver)
           
 void find(Resource dir, ClassNameResolver resolver)
           
 void find(String[] classNames, ClassNameResolver resolver)
           
 void find(String className, ClassNameResolver resolver)
           
 void find(URI[] uris, ClassNameResolver resolver)
          Find annotations in classes in the supplied url of jar files.
 List<Class<?>> getClassesForAnnotation(Class<?> annotationClass)
           
 List<Field> getFieldsForAnnotation(Class<?> annotation)
           
 List<Method> getMethodsForAnnotation(Class<?> annotationClass)
           
static String normalize(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationFinder

public AnnotationFinder()
Method Detail

normalize

public static String normalize(String name)

convertType

public static Class convertType(org.objectweb.asm.Type t)
                         throws Exception
Throws:
Exception

convertTypes

public static Class[] convertTypes(org.objectweb.asm.Type[] types)
                            throws Exception
Throws:
Exception

find

public void find(String className,
                 ClassNameResolver resolver)
          throws Exception
Throws:
Exception

find

public void find(String[] classNames,
                 ClassNameResolver resolver)
          throws Exception
Throws:
Exception

find

public void find(List<String> classNames,
                 ClassNameResolver resolver)
          throws Exception
Throws:
Exception

find

public void find(Resource dir,
                 ClassNameResolver resolver)
          throws Exception
Throws:
Exception

find

public void find(ClassLoader loader,
                 boolean visitParents,
                 boolean nullInclusive,
                 ClassNameResolver resolver)
          throws Exception
Find annotations on classes in the supplied classloader. Only class files in jar files will be scanned.

Parameters:
loader -
visitParents -
jarNamePattern -
nullInclusive -
resolver -
Throws:
Exception

find

public void find(URI[] uris,
                 ClassNameResolver resolver)
          throws Exception
Find annotations in classes in the supplied url of jar files.

Parameters:
uris -
resolver -
Throws:
Exception

excludeClass

protected boolean excludeClass(String name)
Exclude class by name Instances of AnnotationFinder can implement this method to exclude classes by name.

Parameters:
name -
Returns:

getClassesForAnnotation

public List<Class<?>> getClassesForAnnotation(Class<?> annotationClass)
                                       throws Exception
Throws:
Exception

getMethodsForAnnotation

public List<Method> getMethodsForAnnotation(Class<?> annotationClass)
                                     throws Exception
Throws:
Exception

getFieldsForAnnotation

public List<Field> getFieldsForAnnotation(Class<?> annotation)
                                   throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.