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
ConstructorsModifierConstructorDescriptionprotectedCreates a newAnnotatedConstruct.protectedAnnotatedConstruct(Collection<? extends AnnotationMirror> annotationMirrors) Creates a newAnnotatedConstruct.protectedAnnotatedConstruct(AnnotationMirror annotationMirror) Creates a newAnnotatedConstruct. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anAnnotationMirrorto thisAnnotatedConstruct.final voidaddAnnotationMirrors(Iterable<? extends AnnotationMirror> as) AddsAnnotationMirrors to thisAnnotatedConstruct.<A extends Annotation>
AgetAnnotation(Class<A> annotationType) List<? extends AnnotationMirror> <A extends Annotation>
A[]getAnnotationsByType(Class<A> annotationType) protected AnnotationMirrorReturns a valid version of the suppliedAnnotationMirror, or throws some kind ofRuntimeExceptionif validation fails.
-
Constructor Details
-
AnnotatedConstruct
protected AnnotatedConstruct()Creates a newAnnotatedConstruct.- See Also:
-
AnnotatedConstruct
Creates a newAnnotatedConstruct.- Parameters:
annotationMirror- anAnnotationMirrorto be borne by the new object- See Also:
-
AnnotatedConstruct
Creates a newAnnotatedConstruct.- Parameters:
annotationMirrors- aCollectionofAnnotationMirrors to be borne by the new object
-
-
Method Details
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedConstruct
-
getAnnotationsByType
- Specified by:
getAnnotationsByTypein interfaceAnnotatedConstruct
-
getAnnotationMirrors
- Specified by:
getAnnotationMirrorsin interfaceAnnotatedConstruct
-
addAnnotationMirror
Adds anAnnotationMirrorto thisAnnotatedConstruct.- Parameters:
a- theAnnotationMirrorto add; must not benull- Throws:
NullPointerException- ifaisnull
-
addAnnotationMirrors
AddsAnnotationMirrors to thisAnnotatedConstruct.- Parameters:
as- theAnnotationMirrors to add; must not benulland must not producenullelements- Throws:
NullPointerException- ifasisnullor produces anullelement
-
validateAnnotationMirror
Returns a valid version of the suppliedAnnotationMirror, or throws some kind ofRuntimeExceptionif validation fails.This implementation simply checks to see if the supplied
AnnotationMirroris non-null.- Parameters:
a- theAnnotationMirrorto validate; must not benull- Returns:
- a valid version of the supplied
AnnotationMirror; this implementation simply returns the suppliedAnnotationMirror - Throws:
NullPointerException- ifaisnull
-