Interface AnnotatedDescriptor
-
- All Known Subinterfaces:
GenericDescriptor
- All Known Implementing Classes:
AnnotatedDescriptorImpl
,Descriptor
,EnumDescriptor
,FieldDescriptor
public interface AnnotatedDescriptor
Base class for all descriptors. Provides common methods for naming, accessing the attached documentation and annotations.- Since:
- 2.0
- Author:
- [email protected]
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,AnnotationElement.Annotation>
getAnnotations()
Get the documentation annotations in the form of a map of abstract syntax trees ofAnnotationElement
nodes.String
getDocumentation()
Return the documentation text associated with this descriptor.FileDescriptor
getFileDescriptor()
Return the containing files's descriptorString
getFullName()
Return the full name of the descriptor.String
getName()
Return the name of the descriptor.<T> T
getProcessedAnnotation(String annotationName)
Get the 'processed' annotation object created by the registeredAnnotationMetadataCreator
ornull
if the annotation is missing or noAnnotationMetadataCreator
was registered.
-
-
-
Method Detail
-
getName
String getName()
Return the name of the descriptor.- Returns:
- the name of the descriptor (never
null
)
-
getFullName
String getFullName()
Return the full name of the descriptor.- Returns:
- the name of the descriptor (never
null
)
-
getFileDescriptor
FileDescriptor getFileDescriptor()
Return the containing files's descriptor- Returns:
- the containing files's descriptor (never
null
)
-
getDocumentation
String getDocumentation()
Return the documentation text associated with this descriptor.- Returns:
- the documentation text or
null
if not present
-
getAnnotations
Map<String,AnnotationElement.Annotation> getAnnotations() throws AnnotationParserException
Get the documentation annotations in the form of a map of abstract syntax trees ofAnnotationElement
nodes. Only the configured annotations are returned. The unconfigured ones are discarded immediately after parsing.The parsing of annotations is performed lazily on first invocation.
- Returns:
- the map of annotations
- Throws:
AnnotationParserException
- if parsing of annotations fails
-
getProcessedAnnotation
<T> T getProcessedAnnotation(String annotationName) throws AnnotationParserException
Get the 'processed' annotation object created by the registeredAnnotationMetadataCreator
ornull
if the annotation is missing or noAnnotationMetadataCreator
was registered.- Type Parameters:
T
- the expected type of the object created by theAnnotationMetadataCreator
- Parameters:
annotationName
- the name of the annotation- Returns:
- the 'processed' annotation object or
null
if not found - Throws:
AnnotationParserException
- if parsing of annotations fails
-
-