public abstract class AnnotatedElement extends Object implements AnnotatedElement
| Modifier and Type | Field and Description |
|---|---|
protected Object |
declaredAnnotationDatas
Annotations from the class file that are described as runtime
visible.
|
private Annotation[] |
declaredAnnotations
Cached array of declared annotations.
|
private static Annotation[] |
emptyAnnotationArray
Empty annotation array
|
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotatedElement(RVMAnnotation[] annotations)
Constructor used by all annotated elements
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByTypeprotected final Object declaredAnnotationDatas
private Annotation[] declaredAnnotations
private static final Annotation[] emptyAnnotationArray
protected AnnotatedElement(RVMAnnotation[] annotations)
annotations - array of runtime visible annotationsprotected static RVMAnnotation[] readAnnotations(int[] constantPool, DataInputStream input, ClassLoader classLoader) throws IOException
IOExceptionpublic final Annotation[] getAnnotations()
getAnnotations in interface AnnotatedElementAnnotation[] getAnnotationsInternal()
public final Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations in interface AnnotatedElementfinal Annotation[] getDeclaredAnnotationsInternal()
private Annotation[] cloneAnnotations(Annotation[] internal)
final Annotation[] toAnnotations(Object datas)
datas - the annotations.public final <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation in interface AnnotatedElementpublic final boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
isAnnotationPresent in interface AnnotatedElementfinal boolean isAnnotationDeclared(TypeReference annotationTypeRef)
This is provided as an alternative to isAnnotationPresent() as isAnnotationPresent() may require classloading and instantiation of annotations. Classloading would mean that it would not be @Uninterruptible. Instantiation is not desirable as checking of annotations occurs prior to the bootimage compiler being ready to instantiate objects.
annotationTypeRef - the annotation to check fortrue if annotation present.public final boolean hasAnnotations()
true if the element has at least one annotationpublic final boolean hasInterruptibleAnnotation()
true if this element has a Interruptible annotation.Interruptiblepublic final boolean hasLogicallyUninterruptibleAnnotation()
true if this element has a LogicallyUninterruptible annotation.LogicallyUninterruptiblepublic final boolean hasPreemptibleAnnotation()
true if this element has a Preemptible annotation.Preemptiblepublic final boolean hasUninterruptibleNoWarnAnnotation()
true if this element has a UninterruptibleNoWarn annotation.UninterruptibleNoWarnpublic final boolean hasUnpreemptibleNoWarnAnnotation()
true if this element has a UninterruptibleNoWarn annotation.UninterruptibleNoWarnpublic final boolean hasUninterruptibleAnnotation()
true if this element has a Uninterruptible annotation.Uninterruptiblepublic final boolean hasNoCheckStoreAnnotation()
true if this element has a NoCheckStore annotation.NoCheckStorepublic final boolean hasUnpreemptibleAnnotation()
true if this element has a Unpreemptible annotation.Unpreemptiblepublic final boolean hasNoOptCompileAnnotation()
true if this element has a NoOptCompile annotation.NoOptCompilepublic final boolean hasInlineAnnotation()
true if this element has a Inline annotation.Inlinepublic final boolean hasNoInlineAnnotation()
true if this element has a NoInline annotation.NoInlinepublic final boolean hasBaselineNoRegistersAnnotation()
true if this element has a BaselineNoRegisters annotation.BaselineNoRegisterspublic final boolean hasBaselineSaveLSRegistersAnnotation()
true if this element has a BaselineSaveLSRegisters annotation.BaselineSaveLSRegisterspublic final boolean hasPureAnnotation()
true if this element has a Pure annotation.Purepublic final boolean hasRuntimePureAnnotation()
true if this element has a RuntimePure annotation.RuntimePurepublic final boolean hasNoNullCheckAnnotation()
true if this element has a NoNullCheck annotation.NoNullCheckpublic final boolean hasNoBoundsCheckAnnotation()
true if this element has a NoBoundsCheck annotation.NoBoundsCheckpublic final boolean hasRuntimeFinalAnnotation()
true if this element has a RuntimeFinal annotation.RuntimeFinalpublic final boolean hasNoEscapesAnnotation()
true if this element has a NoEscapes annotation.NoEscapespublic final boolean hasUntracedAnnotation()
true if this element has a Untraced annotation.Untracedpublic final boolean hasNonMovingAnnotation()
true if this element has a NonMoving annotation.NonMovingpublic final boolean hasNonMovingAllocationAnnotation()
true if this element has a NonMovingAllocation annotation.NonMovingAllocation