java.lang.Object
org.microbean.lang.AnnotatedConstruct
- All Implemented Interfaces:
AnnotatedConstruct
- Direct Known Subclasses:
Element
,TypeMirror
public abstract sealed class AnnotatedConstruct
extends Object
implements AnnotatedConstruct
permits Element, TypeMirror
A mutable implementation of the
AnnotatedConstruct
interface.- Author:
- Laird Nelson
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a newAnnotatedConstruct
.protected
AnnotatedConstruct
(Collection<? extends AnnotationMirror> annotationMirrors) Creates a newAnnotatedConstruct
.protected
AnnotatedConstruct
(AnnotationMirror annotationMirror) Creates a newAnnotatedConstruct
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anAnnotationMirror
to thisAnnotatedConstruct
.final void
addAnnotationMirrors
(Iterable<? extends AnnotationMirror> as) AddsAnnotationMirror
s to thisAnnotatedConstruct
.<A extends Annotation>
AgetAnnotation
(Class<A> annotationType) List
<? extends AnnotationMirror> <A extends Annotation>
A[]getAnnotationsByType
(Class<A> annotationType) protected AnnotationMirror
Returns a valid version of the suppliedAnnotationMirror
, or throws some kind ofRuntimeException
if validation fails.
-
Constructor Details
-
AnnotatedConstruct
protected AnnotatedConstruct()Creates a newAnnotatedConstruct
.- See Also:
-
AnnotatedConstruct
Creates a newAnnotatedConstruct
.- Parameters:
annotationMirror
- anAnnotationMirror
to be borne by the new object- See Also:
-
AnnotatedConstruct
Creates a newAnnotatedConstruct
.- Parameters:
annotationMirrors
- aCollection
ofAnnotationMirror
s to be borne by the new object
-
-
Method Details
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedConstruct
-
getAnnotationsByType
- Specified by:
getAnnotationsByType
in interfaceAnnotatedConstruct
-
getAnnotationMirrors
- Specified by:
getAnnotationMirrors
in interfaceAnnotatedConstruct
-
addAnnotationMirror
Adds anAnnotationMirror
to thisAnnotatedConstruct
.- Parameters:
a
- theAnnotationMirror
to add; must not benull
- Throws:
NullPointerException
- ifa
isnull
-
addAnnotationMirrors
AddsAnnotationMirror
s to thisAnnotatedConstruct
.- Parameters:
as
- theAnnotationMirror
s to add; must not benull
and must not producenull
elements- Throws:
NullPointerException
- ifas
isnull
or produces anull
element
-
validateAnnotationMirror
Returns a valid version of the suppliedAnnotationMirror
, or throws some kind ofRuntimeException
if validation fails.This implementation simply checks to see if the supplied
AnnotationMirror
is non-null
.- Parameters:
a
- theAnnotationMirror
to validate; must not benull
- Returns:
- a valid version of the supplied
AnnotationMirror
; this implementation simply returns the suppliedAnnotationMirror
- Throws:
NullPointerException
- ifa
isnull
-