public class ClassDescription
extends java.lang.Object
ClassDescription is describing the found annotations
of a class.
Its basically used as a wrapper to hold all the various annotations
found in a class. This description only contains the annotations
found in the current class, but not in any superclass.
The annotations are available as descriptions.| Modifier and Type | Field and Description |
|---|---|
private java.lang.Class<?> |
describedClass
The corresponding class.
|
(package private) java.util.List<AbstractDescription> |
descriptions
All descriptions.
|
private java.lang.String |
source
The source (file) of the class or any other location information.
|
| Constructor and Description |
|---|
ClassDescription(java.lang.Class<?> describedClass,
java.lang.String source)
Create a new class description
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(AbstractDescription desc)
Add a new description
|
ClassDescription |
clone() |
java.lang.Class<?> |
getDescribedClass()
Get the associated class.
|
<T extends AbstractDescription> |
getDescription(java.lang.Class<T> descType)
Get the first description of that type
|
<T extends AbstractDescription> |
getDescriptions(java.lang.Class<T> descType)
Get all descriptions of that type.
|
java.lang.String |
getSource()
Get the location information like the source file etc.
|
java.lang.String |
toString() |
final java.util.List<AbstractDescription> descriptions
private final java.lang.Class<?> describedClass
private final java.lang.String source
public ClassDescription(java.lang.Class<?> describedClass,
java.lang.String source)
public java.lang.Class<?> getDescribedClass()
public java.lang.String getSource()
public void add(AbstractDescription desc)
public <T extends AbstractDescription> java.util.List<T> getDescriptions(java.lang.Class<T> descType)
descType - The description class.public <T extends AbstractDescription> T getDescription(java.lang.Class<T> descType)
descType - The description classnullpublic java.lang.String toString()
toString in class java.lang.Objectpublic ClassDescription clone()
clone in class java.lang.Object