org.codehaus.aspectwerkz.annotation
Class AnnotationManager

java.lang.Object
  extended by org.codehaus.aspectwerkz.annotation.AnnotationManager

public class AnnotationManager
extends Object

Parses and retrieves annotations.

Author:
Jonas BonŽr , Alexandre Vasseur

Constructor Summary
AnnotationManager(ClassLoader loader)
          Constructs a new annotation manager and had the given ClassLoader to the search path
 
Method Summary
 void addSource(String srcFile)
          Adds a source file.
 void addSourceTrees(String[] srcDirs)
          Adds a source tree to the builder.
 com.thoughtworks.qdox.model.JavaClass[] getAllClasses()
          Returns all classes.
 Annotation[] getAnnotations(String name, com.thoughtworks.qdox.model.JavaClass clazz)
          Returns the annotations with a specific name for a specific class.
 Annotation[] getAnnotations(String name, com.thoughtworks.qdox.model.JavaField field)
          Returns the annotations with a specific name for a specific field.
 Annotation[] getAnnotations(String name, com.thoughtworks.qdox.model.JavaMethod method)
          Returns the annotations with a specific name for a specific method.
static Annotation instantiateNestedAnnotation(Class annotationClass, Map elements)
          Instantiate an annotation given its interface and elements It is used only for nested annotation hence requires typed annotation without nicknames.
 void registerAnnotationProxy(Class proxyClass, String docletName)
          Register an annotation together with its proxy implementation under a doclet name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationManager

public AnnotationManager(ClassLoader loader)
Constructs a new annotation manager and had the given ClassLoader to the search path

Parameters:
loader -
Method Detail

addSourceTrees

public void addSourceTrees(String[] srcDirs)
Adds a source tree to the builder.

Parameters:
srcDirs - the source trees

addSource

public void addSource(String srcFile)
Adds a source file.

Parameters:
srcFile - the source file

registerAnnotationProxy

public void registerAnnotationProxy(Class proxyClass,
                                    String docletName)
Register an annotation together with its proxy implementation under a doclet name

Parameters:
proxyClass - the proxy class
docletName - the name of the doclet. The annotation name is the proxy FQN.

getAllClasses

public com.thoughtworks.qdox.model.JavaClass[] getAllClasses()
Returns all classes.

Returns:
an array with all classes

getAnnotations

public Annotation[] getAnnotations(String name,
                                   com.thoughtworks.qdox.model.JavaClass clazz)
Returns the annotations with a specific name for a specific class.

Parameters:
name -
clazz -
Returns:
an array with the annotations

getAnnotations

public Annotation[] getAnnotations(String name,
                                   com.thoughtworks.qdox.model.JavaMethod method)
Returns the annotations with a specific name for a specific method.

Parameters:
name -
method -
Returns:
an array with the annotations

getAnnotations

public Annotation[] getAnnotations(String name,
                                   com.thoughtworks.qdox.model.JavaField field)
Returns the annotations with a specific name for a specific field.

Parameters:
name -
field -
Returns:
an array with the annotations

instantiateNestedAnnotation

public static Annotation instantiateNestedAnnotation(Class annotationClass,
                                                     Map elements)
Instantiate an annotation given its interface and elements It is used only for nested annotation hence requires typed annotation without nicknames. TODO: Note: should we support nicked name nested ? If so grammar needs to track annotation name

Returns:


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.