org.mortbay.jetty.annotations
Class AnnotationCollection

java.lang.Object
  extended by org.mortbay.jetty.annotations.AnnotationCollection

public class AnnotationCollection
extends java.lang.Object

AnnotationCollection An AnnotationCollection represents all of the annotated classes, methods and fields in the inheritance hierarchy for a class. NOTE that methods and fields in this collection are NOT just the ones that are inherited by the class, but represent ALL annotations that must be processed for a single instance of a given class. The class to which this collection pertains is obtained by calling getTargetClass(). Using the list of annotated classes, methods and fields, the collection will generate the appropriate JNDI entries and the appropriate Injection and LifeCycleCallback objects to be later applied to instances of the getTargetClass().


Constructor Summary
AnnotationCollection()
           
 
Method Summary
 void addClass(java.lang.Class clazz)
           
 void addField(java.lang.reflect.Field field)
           
 void addMethod(java.lang.reflect.Method method)
           
 java.util.List getClasses()
           
 java.util.List getFields()
           
 java.util.List getMethods()
           
 java.lang.Class getTargetClass()
          Get the class which is the subject of these annotations
 WebAppContext getWebAppContext()
           
 LifeCycleCallbackCollection processLifeCycleCallbackAnnotations(LifeCycleCallbackCollection callbacks)
          Process @PostConstruct and @PreDestroy annotations.
 InjectionCollection processResourceAnnotations(InjectionCollection injections)
          Process @Resource annotations at the class, method and field level.
 void processResourcesAnnotations()
          Process @Resources annotation on classes
 void processRunAsAnnotations(RunAsCollection runAsCollection)
           
 void setTargetClass(java.lang.Class clazz)
          Set the class to which this collection pertains
 void setWebAppContext(WebAppContext webApp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationCollection

public AnnotationCollection()
Method Detail

setWebAppContext

public void setWebAppContext(WebAppContext webApp)

getWebAppContext

public WebAppContext getWebAppContext()

getTargetClass

public java.lang.Class getTargetClass()
Get the class which is the subject of these annotations

Returns:
the clazz

setTargetClass

public void setTargetClass(java.lang.Class clazz)
Set the class to which this collection pertains

Parameters:
clazz - the clazz to set

addClass

public void addClass(java.lang.Class clazz)

addMethod

public void addMethod(java.lang.reflect.Method method)

addField

public void addField(java.lang.reflect.Field field)

getClasses

public java.util.List getClasses()

getMethods

public java.util.List getMethods()

getFields

public java.util.List getFields()

processRunAsAnnotations

public void processRunAsAnnotations(RunAsCollection runAsCollection)

processResourceAnnotations

public InjectionCollection processResourceAnnotations(InjectionCollection injections)
Process @Resource annotations at the class, method and field level.

Returns:

processLifeCycleCallbackAnnotations

public LifeCycleCallbackCollection processLifeCycleCallbackAnnotations(LifeCycleCallbackCollection callbacks)
Process @PostConstruct and @PreDestroy annotations.

Returns:

processResourcesAnnotations

public void processResourcesAnnotations()
Process @Resources annotation on classes



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