Package org.infinispan.protostream.impl
Class AnnotatedDescriptorImpl
java.lang.Object
org.infinispan.protostream.impl.AnnotatedDescriptorImpl
- All Implemented Interfaces:
AnnotatedDescriptor
- Direct Known Subclasses:
Descriptor
,EnumDescriptor
,FieldDescriptor
- Since:
- 2.0
- Author:
- [email protected]
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
AnnotationElement.Annotation> The annotations found in the documentation.protected final String
The (optional) documentation comment.protected String
protected final String
The annotation metadata objects created by theAnnotationMetadataCreator
based on the annotations found in the documentation text. -
Constructor Summary
ModifierConstructorDescriptionprotected
AnnotatedDescriptorImpl
(String name, String fullName, String documentation) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AnnotationConfiguration
getAnnotationConfig
(AnnotationElement.Annotation annotation) Subclasses are responsible for fetching theAnnotationConfiguration
from the appropriate config (it it exists) and to validate that the target is suitable.protected Configuration.AnnotationsConfig
final String
Return the documentation text associated with this descriptor.final String
Return the full name of the descriptor.final 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.infinispan.protostream.descriptors.AnnotatedDescriptor
getFileDescriptor
-
Field Details
-
name
-
fullName
-
documentation
The (optional) documentation comment. -
annotations
The annotations found in the documentation. -
processedAnnotations
The annotation metadata objects created by theAnnotationMetadataCreator
based on the annotations found in the documentation text.
-
-
Constructor Details
-
AnnotatedDescriptorImpl
-
-
Method Details
-
getName
Description copied from interface:AnnotatedDescriptor
Return the name of the descriptor.- Specified by:
getName
in interfaceAnnotatedDescriptor
- Returns:
- the name of the descriptor (never
null
)
-
getFullName
Description copied from interface:AnnotatedDescriptor
Return the full name of the descriptor.- Specified by:
getFullName
in interfaceAnnotatedDescriptor
- Returns:
- the name of the descriptor (never
null
)
-
getDocumentation
Description copied from interface:AnnotatedDescriptor
Return the documentation text associated with this descriptor.- Specified by:
getDocumentation
in interfaceAnnotatedDescriptor
- Returns:
- the documentation text or
null
if not present
-
getAnnotationsConfig
-
getAnnotationConfig
protected abstract AnnotationConfiguration getAnnotationConfig(AnnotationElement.Annotation annotation) throws DescriptorParserException Subclasses are responsible for fetching theAnnotationConfiguration
from the appropriate config (it it exists) and to validate that the target is suitable.- Returns:
- null if the annotation is not found
- Throws:
DescriptorParserException
- is the annotation target is not suitable for this descriptor
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedDescriptor
- Throws:
AnnotationParserException
-
getProcessedAnnotation
Description copied from interface:AnnotatedDescriptor
Get the 'processed' annotation object created by the registeredAnnotationMetadataCreator
ornull
if the annotation is missing or noAnnotationMetadataCreator
was registered.- Specified by:
getProcessedAnnotation
in interfaceAnnotatedDescriptor
- 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
-