org.progeeks.meta.annotate
Class AnnotationManager

java.lang.Object
  extended by org.progeeks.meta.annotate.AnnotationManager

public class AnnotationManager
extends java.lang.Object

Provides access to registered AnnotationMaps and will create them on demand for previously unattached AnnotationTypes. AnnotationManagers can be registered per thread context in a way similar to MetaClassRegistry.

Version:
$Revision: 1.3 $
Author:
Paul Speed

Constructor Summary
protected AnnotationManager()
          Creates a new annotation manager with no parent.
  AnnotationManager(AnnotationManager parent)
          Creates a new annotation manager with the specified parent.
 
Method Summary
 AnnotationMap getAnnotationMap(AnnotationType type)
          Returns the AnnotationMap for the specified AnnotationType.
static AnnotationManager getContextAnnotationManager()
          Returns the current thread's default AnnotationManager.
static AnnotationMap getContextAnnotationMap(AnnotationType type)
          Convenience method that uses the context AnnoationManager to lookup an AnnotationMap for the specified type.
 AnnotationManager getParentManager()
          Returns the parent annotation manager for this manager or null if this is a root AnnotationManager.
static AnnotationManager getRootAnnotationManager()
          Returns the root annotation manager.
 void registerAnnotationMap(AnnotationType type, AnnotationMap map)
          Registers an AnnotationMap instance for the specified AnnotationType.
static void setContextAnnotationManager(AnnotationManager am)
          Returns the current thread's default AnnotationManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationManager

protected AnnotationManager()
Creates a new annotation manager with no parent.


AnnotationManager

public AnnotationManager(AnnotationManager parent)
Creates a new annotation manager with the specified parent.

Method Detail

getParentManager

public AnnotationManager getParentManager()
Returns the parent annotation manager for this manager or null if this is a root AnnotationManager.


registerAnnotationMap

public void registerAnnotationMap(AnnotationType type,
                                  AnnotationMap map)
Registers an AnnotationMap instance for the specified AnnotationType.


getAnnotationMap

public AnnotationMap getAnnotationMap(AnnotationType type)
Returns the AnnotationMap for the specified AnnotationType. If the annotation type does not have a map currently registered then one will be created.


getContextAnnotationManager

public static AnnotationManager getContextAnnotationManager()
Returns the current thread's default AnnotationManager. This will be the last value supplied to the setContextAnnotationManager() method by this thread or the root manager if none has been specified.


setContextAnnotationManager

public static void setContextAnnotationManager(AnnotationManager am)
Returns the current thread's default AnnotationManager.


getRootAnnotationManager

public static AnnotationManager getRootAnnotationManager()
Returns the root annotation manager.


getContextAnnotationMap

public static AnnotationMap getContextAnnotationMap(AnnotationType type)
Convenience method that uses the context AnnoationManager to lookup an AnnotationMap for the specified type.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.