public abstract class AnnotatedDescriptorImpl extends Object implements AnnotatedDescriptor
Modifier and Type | Field and Description |
---|---|
protected Map<String,AnnotationElement.Annotation> |
annotations
The annotations found in the documentation.
|
protected String |
documentation
The (optional) documentation comment.
|
protected String |
fullName |
protected String |
name |
protected Map<String,Object> |
processedAnnotations
The annotation metadata objects created by the
AnnotationMetadataCreator based
on the annotations found in the documentation text. |
Modifier | Constructor and Description |
---|---|
protected |
AnnotatedDescriptorImpl(String name,
String fullName,
String documentation) |
Modifier and Type | Method and Description |
---|---|
protected abstract AnnotationConfiguration |
getAnnotationConfig(String annotationName)
Subclasses are responsible for fetching the
AnnotationConfiguration from the appropriate config (it it
exists) and to validate that the target is suitable. |
Map<String,AnnotationElement.Annotation> |
getAnnotations()
Get the documentation annotations in the form of a map of abstract syntax trees of
AnnotationElement nodes. |
protected Configuration.AnnotationsConfig |
getAnnotationsConfig() |
String |
getDocumentation()
Return the documentation text associated with this descriptor.
|
String |
getFullName()
Return the fulla 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 registered
AnnotationMetadataCreator
or null if the annotation is missing or no AnnotationMetadataCreator
was registered. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFileDescriptor
protected final String name
protected String fullName
protected final String documentation
protected Map<String,AnnotationElement.Annotation> annotations
protected Map<String,Object> processedAnnotations
AnnotationMetadataCreator
based
on the annotations found in the documentation text.public final String getName()
AnnotatedDescriptor
getName
in interface AnnotatedDescriptor
null
)public final String getFullName()
AnnotatedDescriptor
getFullName
in interface AnnotatedDescriptor
null
)public final String getDocumentation()
AnnotatedDescriptor
getDocumentation
in interface AnnotatedDescriptor
null
if not presentprotected Configuration.AnnotationsConfig getAnnotationsConfig()
protected abstract AnnotationConfiguration getAnnotationConfig(String annotationName) throws DescriptorParserException
AnnotationConfiguration
from the appropriate config (it it
exists) and to validate that the target is suitable.DescriptorParserException
- is the annotation target is not suitable for this descriptorpublic Map<String,AnnotationElement.Annotation> getAnnotations() throws AnnotationParserException
AnnotatedDescriptor
AnnotationElement
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.
getAnnotations
in interface AnnotatedDescriptor
AnnotationParserException
- if parsing of annotations failspublic <T> T getProcessedAnnotation(String annotationName) throws AnnotationParserException
AnnotatedDescriptor
AnnotationMetadataCreator
or null
if the annotation is missing or no AnnotationMetadataCreator
was registered.getProcessedAnnotation
in interface AnnotatedDescriptor
T
- the expected type of the object created by the AnnotationMetadataCreator
annotationName
- the name of the annotationnull
if not foundAnnotationParserException
- if parsing of annotations failsCopyright © 2019 JBoss, a division of Red Hat. All rights reserved.