Class ParseElement<E extends AnnotatedElement>
java.lang.Object
studio.mevera.imperat.annotations.base.element.ParseElement<E>
- All Implemented Interfaces:
Iterable<Annotation>,AnnotatedElement
- Direct Known Subclasses:
ClassElement,MethodElement,ParameterElement
public abstract sealed class ParseElement<E extends AnnotatedElement>
extends Object
implements AnnotatedElement, Iterable<Annotation>
permits ClassElement, MethodElement, ParameterElement
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull AnnotationMapprotected final Eprotected final @Nullable ParseElement<?>protected final AnnotationParser<?> -
Constructor Summary
ConstructorsConstructorDescriptionParseElement(@NotNull AnnotationParser<S> parser, @Nullable ParseElement<?> parent, E element) -
Method Summary
Modifier and TypeMethodDescriptionboolean<T extends Annotation>
TgetAnnotation(@NotNull Class<T> annotationClass) Returns this element's annotation for the specified valueType if such an annotation is present, else null.Annotation @NotNull []Returns annotations that are present on this element.Annotation @NotNull []Returns annotations that are directly present on this element.abstract StringgetName()@Nullable ParseElement<?>inthashCode()@NotNull Iterator<Annotation>iterator()Returns an iterator over elements of valueTypeT.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.reflect.AnnotatedElement
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType, isAnnotationPresentMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
parser
-
annotations
-
parent
-
element
-
-
Constructor Details
-
ParseElement
public ParseElement(@NotNull @NotNull AnnotationParser<S> parser, @Nullable @Nullable ParseElement<?> parent, @NotNull E element)
-
-
Method Details
-
getAnnotation
Returns this element's annotation for the specified valueType if such an annotation is present, else null.- Specified by:
getAnnotationin interfaceAnnotatedElement- Parameters:
annotationClass- the Class object corresponding to the annotation valueType- Returns:
- this element's annotation for the specified annotation valueType if present on this element, else null
- Throws:
NullPointerException- if the given annotation class is null- Since:
- 1.5
-
getAnnotations
Returns annotations that are present on this element.If there are no annotations present on this element, the return value is an array of length 0.
The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
- Specified by:
getAnnotationsin interfaceAnnotatedElement- Returns:
- annotations present on this element
- Since:
- 1.5
-
getDeclaredAnnotations
Returns annotations that are directly present on this element. This method ignores inherited annotations.If there are no annotations directly present on this element, the return value is an array of length 0.
The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement- Returns:
- annotations directly present on this element
- Since:
- 1.5
-
iterator
Returns an iterator over elements of valueTypeT.- Specified by:
iteratorin interfaceIterable<E extends AnnotatedElement>- Returns:
- an Iterator.
-
toString
-
equals
-
hashCode
public int hashCode() -
getName
-
getParent
-
getElement
-