APIdia Launch Partner
Top Description Constructors Methods
com.sun.tools.javac.code

public abstract Class AnnoConstruct

extends Object
implements AnnotatedConstruct
Class Inheritance
All Implemented Interfaces
javax.lang.model.AnnotatedConstruct
Known Direct Subclasses
com.sun.tools.javac.code.Symbol, com.sun.tools.javac.code.Type
Imports
java.lang.annotation.Annotation, .Inherited, .Repeatable, java.lang.reflect.InvocationTargetException, .Method, javax.lang.model.AnnotatedConstruct, com.sun.tools.javac.model.AnnotationProxyMaker, com.sun.tools.javac.util.DefinedBy, .DefinedBy.Api, .List, .ListBuffer

Common supertype for annotated constructs such as Types and Symbols. This class should *not* contain any fields since it would have a significant impact on the javac memory footprint.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <A extends Annotation> A
getAnnotation(Class<A> annoType)

Implements javax.lang.model.AnnotatedConstruct.getAnnotation.

Returns this construct's annotation of the specified type if such an annotation is present, else null.

public abstract List<? extends Attribute.Compound>
getAnnotationMirrors()

Redeclares javax.lang.model.AnnotatedConstruct.getAnnotationMirrors.

Returns the annotations that are directly present on this construct.

public <A extends Annotation> A[]
getAnnotationsByType(Class<A> annoType)

Implements javax.lang.model.AnnotatedConstruct.getAnnotationsByType.

Returns annotations of the specified type that are associated with this construct.

protected <A extends Annotation> Attribute.Compound
getAttribute(Class<A> annoType)

private static Class<? extends Annotation>
getContainer(Class<? extends Annotation> annoType)

protected <A extends Annotation> A[]
private static Attribute[]
private Attribute.Compound[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AnnoConstructback to summary
public AnnoConstruct()

Method Detail

getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> annoType)

Implements javax.lang.model.AnnotatedConstruct.getAnnotation.

Doc from javax.lang.model.AnnotatedConstruct.getAnnotation.

Returns this construct's annotation of the specified type if such an annotation is present, else null.

The annotation returned by this method could contain an element whose value is of type Class. This value cannot be returned directly: information necessary to locate and load a class (such as the class loader to use) is not available, and the class might not be loadable at all. Attempting to read a Class object by invoking the relevant method on the returned annotation will result in a MirroredTypeException, from which the corresponding TypeMirror may be extracted. Similarly, attempting to read a Class[]-valued element will result in a MirroredTypesException.

Note

This method is unlike others in this and related interfaces. It operates on runtime reflective information — representations of annotation interfaces currently loaded into the VM — rather than on the representations defined by and used throughout these interfaces. Consequently, calling methods on the returned annotation object can throw many of the exceptions that can be thrown when calling methods on an annotation object returned by core reflection. This method is intended for callers that are written to operate on a known, fixed set of annotation interfaces.

Annotations
@DefinedBy:LANGUAGE_MODEL
getAnnotationMirrorsback to summary
public abstract List<? extends Attribute.Compound> getAnnotationMirrors()

Redeclares javax.lang.model.AnnotatedConstruct.getAnnotationMirrors.

Doc from javax.lang.model.AnnotatedConstruct.getAnnotationMirrors.

Returns the annotations that are directly present on this construct.

Annotations
@Override
@DefinedBy:LANGUAGE_MODEL
getAnnotationsByTypeback to summary
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annoType)

Implements javax.lang.model.AnnotatedConstruct.getAnnotationsByType.

Doc from javax.lang.model.AnnotatedConstruct.getAnnotationsByType.

Returns annotations of the specified type that are associated with this construct. If there are no annotations of the specified type associated with this construct, the return value is an array of length 0. The order of annotations which are directly or indirectly present on a construct C is computed as if indirectly present annotations on C are directly present on C in place of their container annotation, in the order in which they appear in the value element of the container annotation. The difference between this method and getAnnotation(Class) is that this method detects if its argument is a repeatable annotation interface, and if so, attempts to find one or more annotations of that type by "looking through" a container annotation.

The annotations returned by this method could contain an element whose value is of type Class. This value cannot be returned directly: information necessary to locate and load a class (such as the class loader to use) is not available, and the class might not be loadable at all. Attempting to read a Class object by invoking the relevant method on the returned annotation will result in a MirroredTypeException, from which the corresponding TypeMirror may be extracted. Similarly, attempting to read a Class[]-valued element will result in a MirroredTypesException.

Note

This method is unlike others in this and related interfaces. It operates on runtime reflective information — representations of annotation interfaces currently loaded into the VM — rather than on the representations defined by and used throughout these interfaces. Consequently, calling methods on the returned annotation object can throw many of the exceptions that can be thrown when calling methods on an annotation object returned by core reflection. This method is intended for callers that are written to operate on a known, fixed set of annotation interfaces.

Annotations
@DefinedBy:LANGUAGE_MODEL
getAttributeback to summary
protected <A extends Annotation> Attribute.Compound getAttribute(Class<A> annoType)
getContainerback to summary
private static Class<? extends Annotation> getContainer(Class<? extends Annotation> annoType)
getInheritedAnnotationsback to summary
protected <A extends Annotation> A[] getInheritedAnnotations(Class<A> annoType)
Annotations
@SuppressWarnings:unchecked
unpackAttributesback to summary
private static Attribute[] unpackAttributes(Attribute.Compound container)
unpackContainedback to summary
private Attribute.Compound[] unpackContained(Attribute.Compound container)