org.eclipse.jetty.annotations
类 AnnotationParser

java.lang.Object
  继承者 org.eclipse.jetty.annotations.AnnotationParser

public class AnnotationParser
extends Object

AnnotationParser Use asm to scan classes for annotations. A SAX-style parsing is done, with a handler being able to be registered to handle each annotation type.


嵌套类摘要
static interface AnnotationParser.ClassHandler
          ClassHandler Responds to finding a Class
static interface AnnotationParser.DiscoverableAnnotationHandler
          DiscoverableAnnotationHandler Processes an annotation when it is discovered on a class.
static interface AnnotationParser.FieldHandler
          FieldHandler Responds to finding a Field
static interface AnnotationParser.Handler
          Handler Signature for all handlers that respond to parsing class files.
 class AnnotationParser.ListValue
           
static interface AnnotationParser.MethodHandler
          MethodHandler Responds to finding a Method
 class AnnotationParser.MyAnnotationVisitor
          MyAnnotationVisitor ASM Visitor for Annotations
 class AnnotationParser.MyClassVisitor
          MyClassVisitor ASM visitor for a class.
 class AnnotationParser.SimpleValue
           
 class AnnotationParser.Value
           
 
字段摘要
protected  List<AnnotationParser.Handler> _handlers
           
protected  Set<String> _parsedClassNames
           
 
构造方法摘要
AnnotationParser()
           
 
方法摘要
 void clearHandlers()
          Remove all registered handlers
 boolean deregisterHandler(AnnotationParser.Handler h)
          Remove a particular handler
 List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers()
          已过时。  
 List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers(String annotationName)
          已过时。  
 boolean isParsed(String className)
          True if the class has already been processed, false otherwise
static String normalize(String name)
           
 void parse(Class clazz, ClassNameResolver resolver, boolean visitSuperClasses)
          Parse the given class, optionally walking its inheritance hierarchy
 void parse(ClassLoader loader, boolean visitParents, boolean nullInclusive, ClassNameResolver resolver)
          Parse classes in the supplied classloader.
 void parse(List<String> classNames, ClassNameResolver resolver)
          Parse the given classes
 void parse(Resource dir, ClassNameResolver resolver)
          Parse all classes in a directory
 void parse(String[] classNames, ClassNameResolver resolver)
          Parse the given classes
 void parse(String className, ClassNameResolver resolver)
          Parse a given class
 void parse(URI[] uris, ClassNameResolver resolver)
          Parse classes in the supplied url of jar files.
 void parse(URI uri, ClassNameResolver resolver)
          Parse a particular resource
 void registerAnnotationHandler(String annotationName, AnnotationParser.DiscoverableAnnotationHandler handler)
          已过时。 see registerHandler(Handler)
 void registerClassHandler(AnnotationParser.ClassHandler handler)
          已过时。 see registerHandler(Handler)
 void registerHandler(AnnotationParser.Handler h)
          Add a particular handler
 void registerHandlers(List<? extends AnnotationParser.Handler> handlers)
          Add a list of handlers
protected  void scanClass(InputStream is)
          Use ASM on a class
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

_parsedClassNames

protected Set<String> _parsedClassNames

_handlers

protected List<AnnotationParser.Handler> _handlers
构造方法详细信息

AnnotationParser

public AnnotationParser()
方法详细信息

normalize

public static String normalize(String name)

registerAnnotationHandler

public void registerAnnotationHandler(String annotationName,
                                      AnnotationParser.DiscoverableAnnotationHandler handler)
已过时。 see registerHandler(Handler)

Register a handler that will be called back when the named annotation is encountered on a class.

参数:
annotationName -
handler -

getAnnotationHandlers

public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers(String annotationName)
已过时。 

参数:
annotationName -
返回:

getAnnotationHandlers

public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers()
已过时。 

返回:

registerClassHandler

public void registerClassHandler(AnnotationParser.ClassHandler handler)
已过时。 see registerHandler(Handler)

参数:
handler -

registerHandler

public void registerHandler(AnnotationParser.Handler h)
Add a particular handler

参数:
h -

registerHandlers

public void registerHandlers(List<? extends AnnotationParser.Handler> handlers)
Add a list of handlers

参数:
handlers -

deregisterHandler

public boolean deregisterHandler(AnnotationParser.Handler h)
Remove a particular handler

参数:
h -
返回:

clearHandlers

public void clearHandlers()
Remove all registered handlers


isParsed

public boolean isParsed(String className)
True if the class has already been processed, false otherwise

参数:
className -
返回:

parse

public void parse(String className,
                  ClassNameResolver resolver)
           throws Exception
Parse a given class

参数:
className -
resolver -
抛出:
Exception

parse

public void parse(Class clazz,
                  ClassNameResolver resolver,
                  boolean visitSuperClasses)
           throws Exception
Parse the given class, optionally walking its inheritance hierarchy

参数:
clazz -
resolver -
visitSuperClasses -
抛出:
Exception

parse

public void parse(String[] classNames,
                  ClassNameResolver resolver)
           throws Exception
Parse the given classes

参数:
classNames -
resolver -
抛出:
Exception

parse

public void parse(List<String> classNames,
                  ClassNameResolver resolver)
           throws Exception
Parse the given classes

参数:
classNames -
resolver -
抛出:
Exception

parse

public void parse(Resource dir,
                  ClassNameResolver resolver)
           throws Exception
Parse all classes in a directory

参数:
dir -
resolver -
抛出:
Exception

parse

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

参数:
loader -
visitParents -
nullInclusive -
resolver -
抛出:
Exception

parse

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

参数:
uris -
resolver -
抛出:
Exception

parse

public void parse(URI uri,
                  ClassNameResolver resolver)
           throws Exception
Parse a particular resource

参数:
uri -
resolver -
抛出:
Exception

scanClass

protected void scanClass(InputStream is)
                  throws IOException
Use ASM on a class

参数:
is -
抛出:
IOException


Copyright © 2013. All Rights Reserved.