public class AnnotationParser extends Object
Modifier and Type | Class and Description |
---|---|
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 |
Modifier and Type | Field and Description |
---|---|
protected List<AnnotationParser.Handler> |
_handlers |
protected List<String> |
_parsedClassNames |
Constructor and Description |
---|
AnnotationParser() |
Modifier and Type | Method and Description |
---|---|
void |
clearHandlers()
Remove all registered handlers
|
boolean |
deregisterHandler(AnnotationParser.Handler h)
Remove a particular handler
|
List<AnnotationParser.DiscoverableAnnotationHandler> |
getAnnotationHandlers()
Deprecated.
|
List<AnnotationParser.DiscoverableAnnotationHandler> |
getAnnotationHandlers(String annotationName)
Deprecated.
|
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)
Deprecated.
see registerHandler(Handler)
|
void |
registerClassHandler(AnnotationParser.ClassHandler handler)
Deprecated.
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
|
protected List<AnnotationParser.Handler> _handlers
public void registerAnnotationHandler(String annotationName, AnnotationParser.DiscoverableAnnotationHandler handler)
annotationName
- handler
- public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers(String annotationName)
annotationName
- public List<AnnotationParser.DiscoverableAnnotationHandler> getAnnotationHandlers()
public void registerClassHandler(AnnotationParser.ClassHandler handler)
handler
- public void registerHandler(AnnotationParser.Handler h)
h
- public void registerHandlers(List<? extends AnnotationParser.Handler> handlers)
handlers
- public boolean deregisterHandler(AnnotationParser.Handler h)
h
- public void clearHandlers()
public boolean isParsed(String className)
className
- public void parse(String className, ClassNameResolver resolver) throws Exception
className
- resolver
- Exception
public void parse(Class clazz, ClassNameResolver resolver, boolean visitSuperClasses) throws Exception
clazz
- resolver
- visitSuperClasses
- Exception
public void parse(String[] classNames, ClassNameResolver resolver) throws Exception
classNames
- resolver
- Exception
public void parse(List<String> classNames, ClassNameResolver resolver) throws Exception
classNames
- resolver
- Exception
public void parse(Resource dir, ClassNameResolver resolver) throws Exception
dir
- resolver
- Exception
public void parse(ClassLoader loader, boolean visitParents, boolean nullInclusive, ClassNameResolver resolver) throws Exception
loader
- visitParents
- nullInclusive
- resolver
- Exception
public void parse(URI[] uris, ClassNameResolver resolver) throws Exception
uris
- resolver
- Exception
public void parse(URI uri, ClassNameResolver resolver) throws Exception
uri
- resolver
- Exception
protected void scanClass(InputStream is) throws IOException
is
- IOException
Copyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.