org.apache.felix.scrplugin.description
Class ClassDescription

java.lang.Object
  extended by org.apache.felix.scrplugin.description.ClassDescription

public class ClassDescription
extends java.lang.Object

A 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.

See Also:
ComponentDescription, ServiceDescription, ReferenceDescription, PropertyDescription

Constructor Summary
ClassDescription(java.lang.Class<?> describedClass, java.lang.String source)
          Create a new class description
 
Method Summary
 void add(AbstractDescription desc)
          Add a new description
 ClassDescription clone()
           
 java.lang.Class<?> getDescribedClass()
          Get the associated class.
<T extends AbstractDescription>
T
getDescription(java.lang.Class<T> descType)
          Get the first description of that type
<T extends AbstractDescription>
java.util.List<T>
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()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDescription

public ClassDescription(java.lang.Class<?> describedClass,
                        java.lang.String source)
Create a new class description

Method Detail

getDescribedClass

public java.lang.Class<?> getDescribedClass()
Get the associated class.

Returns:
The associated class.

getSource

public java.lang.String getSource()
Get the location information like the source file etc.

Returns:
The location information.

add

public void add(AbstractDescription desc)
Add a new description


getDescriptions

public <T extends AbstractDescription> java.util.List<T> getDescriptions(java.lang.Class<T> descType)
Get all descriptions of that type.

Parameters:
descType - The description class.
Returns:
A list of found descriptions or the empty array.

getDescription

public <T extends AbstractDescription> T getDescription(java.lang.Class<T> descType)
Get the first description of that type

Parameters:
descType - The description class
Returns:
THe first description or null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public ClassDescription clone()
Overrides:
clone in class java.lang.Object


Copyright © 2006-2013 The Apache Software Foundation. All Rights Reserved.