org.jboss.deployers.spi.annotations
Interface AnnotationEnvironment

All Known Implementing Classes:
DefaultAnnotationEnvironment

public interface AnnotationEnvironment

Information holder about annotation processing. Implementations should delay the actual class loading until it's absolutely necessary. All methods that have annotation name as parameter will use unit's classloader to load the actual annotation class.

Author:
Ales Justin

Method Summary
<A extends Annotation>
Set<Element<A,Constructor<?>>>
classHasConstructorAnnotatedWith(Class<A> annotation)
          Get all classes who have some constructor annotated with annotation param.
 Set<Element<Annotation,Constructor<?>>> classHasConstructorAnnotatedWith(String annotationName)
          Get all classes who have some constructor annotated with annotation param.
<A extends Annotation>
Set<Element<A,Field>>
classHasFieldAnnotatedWith(Class<A> annotation)
          Get all classes who have some field annotated with annotation param.
 Set<Element<Annotation,Field>> classHasFieldAnnotatedWith(String annotationName)
          Get all classes who have some field annotated with annotation param.
<A extends Annotation>
Set<Element<A,Method>>
classHasMethodAnnotatedWith(Class<A> annotation)
          Get all classes who have some method annotated with annotation param.
 Set<Element<Annotation,Method>> classHasMethodAnnotatedWith(String annotationName)
          Get all classes who have some method annotated with annotation param.
<A extends Annotation>
Set<Element<A,AnnotatedElement>>
classHasParameterAnnotatedWith(Class<A> annotation)
          Get all classes who have some method's/constructor's parameter annotated with annotation param.
 Set<Element<Annotation,AnnotatedElement>> classHasParameterAnnotatedWith(String annotationName)
          Get all classes who have some method's/constructor's parameter annotated with annotation param.
<A extends Annotation>
Set<Element<A,Class<?>>>
classIsAnnotatedWith(Class<A> annotation)
          Get all classes annotated with annotation param.
 Set<Element<Annotation,Class<?>>> classIsAnnotatedWith(String annotationName)
          Get all classes annotated with annotation param.
 boolean hasClassAnnotatedWith(Class<? extends Annotation> annotation)
          Does this annotation environment contain a class which is annotated with annotation parameter.
 boolean hasClassAnnotatedWith(String annotationName)
          Does this annotation environment contain a class which is annotated with annotation parameter.
 

Method Detail

hasClassAnnotatedWith

boolean hasClassAnnotatedWith(Class<? extends Annotation> annotation)
Does this annotation environment contain a class which is annotated with annotation parameter. This only applies to annotations for ElementType.TYPE level. This method should be used if we have no intention to do real lookup of annotated classes, but we're only interested in existance of the annotation. e.g. deployment unit contains @Stateful EJBs

Parameters:
annotation - the annotation we're querying for
Returns:
true if there exists a class with annotation param
See Also:
hasClassAnnotatedWith(Class annotation)

hasClassAnnotatedWith

boolean hasClassAnnotatedWith(String annotationName)
Does this annotation environment contain a class which is annotated with annotation parameter. This only applies to annotations for ElementType.TYPE level. This method should be used if we have no intention to do real lookup of annotated classes, but we're only interested in existance of the annotation. e.g. deployment unit contains @Stateful EJBs

Parameters:
annotationName - the annotation name we're querying for
Returns:
true if there exists a class with annotation param
See Also:
hasClassAnnotatedWith(Class annotation)

classIsAnnotatedWith

<A extends Annotation> Set<Element<A,Class<?>>> classIsAnnotatedWith(Class<A> annotation)
Get all classes annotated with annotation param.

Type Parameters:
A - the annotation type
Parameters:
annotation - the annotation we're querying for
Returns:
set of matching classes

classIsAnnotatedWith

Set<Element<Annotation,Class<?>>> classIsAnnotatedWith(String annotationName)
Get all classes annotated with annotation param.

Parameters:
annotationName - the annotation name we're querying for
Returns:
set of matching classes

classHasConstructorAnnotatedWith

<A extends Annotation> Set<Element<A,Constructor<?>>> classHasConstructorAnnotatedWith(Class<A> annotation)
Get all classes who have some constructor annotated with annotation param.

Type Parameters:
A - the annotation type
Parameters:
annotation - the annotation we're querying for
Returns:
set of matching classes

classHasConstructorAnnotatedWith

Set<Element<Annotation,Constructor<?>>> classHasConstructorAnnotatedWith(String annotationName)
Get all classes who have some constructor annotated with annotation param.

Parameters:
annotationName - the annotation name we're querying for
Returns:
set of matching classes

classHasFieldAnnotatedWith

<A extends Annotation> Set<Element<A,Field>> classHasFieldAnnotatedWith(Class<A> annotation)
Get all classes who have some field annotated with annotation param.

Type Parameters:
A - the annotation type
Parameters:
annotation - the annotation we're querying for
Returns:
set of matching classes

classHasFieldAnnotatedWith

Set<Element<Annotation,Field>> classHasFieldAnnotatedWith(String annotationName)
Get all classes who have some field annotated with annotation param.

Parameters:
annotationName - the annotation name we're querying for
Returns:
set of matching classes

classHasMethodAnnotatedWith

<A extends Annotation> Set<Element<A,Method>> classHasMethodAnnotatedWith(Class<A> annotation)
Get all classes who have some method annotated with annotation param.

Type Parameters:
A - the annotation type
Parameters:
annotation - the annotation we're querying for
Returns:
set of matching classes

classHasMethodAnnotatedWith

Set<Element<Annotation,Method>> classHasMethodAnnotatedWith(String annotationName)
Get all classes who have some method annotated with annotation param.

Parameters:
annotationName - the annotation name we're querying for
Returns:
set of matching classes

classHasParameterAnnotatedWith

<A extends Annotation> Set<Element<A,AnnotatedElement>> classHasParameterAnnotatedWith(Class<A> annotation)
Get all classes who have some method's/constructor's parameter annotated with annotation param.

Type Parameters:
A - the annotation type
Parameters:
annotation - the annotation we're querying for
Returns:
set of matching classes

classHasParameterAnnotatedWith

Set<Element<Annotation,AnnotatedElement>> classHasParameterAnnotatedWith(String annotationName)
Get all classes who have some method's/constructor's parameter annotated with annotation param.

Parameters:
annotationName - the annotation name we're querying for
Returns:
set of matching classes


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.