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, wait
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
protected 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
IOException
public final Annotation[] getAnnotations()
getAnnotations
in interface AnnotatedElement
Annotation[] getAnnotationsInternal()
public final Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations
in interface AnnotatedElement
final 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 AnnotatedElement
public final boolean isAnnotationPresent(Class<? extends Annotation> annotationClass)
isAnnotationPresent
in interface AnnotatedElement
final 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.Interruptible
public final boolean hasLogicallyUninterruptibleAnnotation()
true
if this element has a LogicallyUninterruptible annotation.LogicallyUninterruptible
public final boolean hasPreemptibleAnnotation()
true
if this element has a Preemptible annotation.Preemptible
public final boolean hasUninterruptibleNoWarnAnnotation()
true
if this element has a UninterruptibleNoWarn annotation.UninterruptibleNoWarn
public final boolean hasUnpreemptibleNoWarnAnnotation()
true
if this element has a UninterruptibleNoWarn annotation.UninterruptibleNoWarn
public final boolean hasUninterruptibleAnnotation()
true
if this element has a Uninterruptible annotation.Uninterruptible
public final boolean hasNoCheckStoreAnnotation()
true
if this element has a NoCheckStore annotation.NoCheckStore
public final boolean hasUnpreemptibleAnnotation()
true
if this element has a Unpreemptible annotation.Unpreemptible
public final boolean hasNoOptCompileAnnotation()
true
if this element has a NoOptCompile annotation.NoOptCompile
public final boolean hasInlineAnnotation()
true
if this element has a Inline annotation.Inline
public final boolean hasNoInlineAnnotation()
true
if this element has a NoInline annotation.NoInline
public final boolean hasBaselineNoRegistersAnnotation()
true
if this element has a BaselineNoRegisters annotation.BaselineNoRegisters
public final boolean hasBaselineSaveLSRegistersAnnotation()
true
if this element has a BaselineSaveLSRegisters annotation.BaselineSaveLSRegisters
public final boolean hasPureAnnotation()
true
if this element has a Pure annotation.Pure
public final boolean hasRuntimePureAnnotation()
true
if this element has a RuntimePure annotation.RuntimePure
public final boolean hasNoNullCheckAnnotation()
true
if this element has a NoNullCheck annotation.NoNullCheck
public final boolean hasNoBoundsCheckAnnotation()
true
if this element has a NoBoundsCheck annotation.NoBoundsCheck
public final boolean hasRuntimeFinalAnnotation()
true
if this element has a RuntimeFinal annotation.RuntimeFinal
public final boolean hasNoEscapesAnnotation()
true
if this element has a NoEscapes annotation.NoEscapes
public final boolean hasUntracedAnnotation()
true
if this element has a Untraced annotation.Untraced
public final boolean hasNonMovingAnnotation()
true
if this element has a NonMoving annotation.NonMoving
public final boolean hasNonMovingAllocationAnnotation()
true
if this element has a NonMovingAllocation annotation.NonMovingAllocation