Top Description Constructors Methods
org.jboss.jandex

public Class ClassExtendsTypeTarget

extends PositionBasedTypeTarget
Class Inheritance

Represents a target of type annotation which occurs in the extends or implements clause of an enclosing class. This class conveys the enclosing class definition, as well as a position to indicate the interface or superclass this target applies to. Since type targets can appear at any depth of the type tree at this location, the corresponding type reference is also included.

The special position 65535 is used to indicate the type usage is on the super type in the extends clause. All other numbers denote the zero-based offset in the interface list of the implements clause.

Consider the following example involving a type target using the Bar annotation:

class Foo<T> implements List<@Bar T> {
}
This example would be represented as a ClassExtendsTypeTarget with an enclosing target of the ClassInfo of Foo, and position() would be 0.
Author
Jason T. Greene
Since
2.0

Constructor Summary

AccessConstructor and Description
pack-priv
ClassExtendsTypeTarget(ClassInfo enclosingTarget, int position)

public
ClassExtendsTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Summary

Modifier and TypeMethod and Description
public ClassExtendsTypeTarget
asClassExtends()

Overrides org.jboss.jandex.TypeTarget.asClassExtends.

Casts and returns this type target as a ClassExtendsTypeTarget.
public ClassInfo
enclosingTarget()

Overrides org.jboss.jandex.TypeTarget.enclosingTarget.

Returns the enclosing target that contains the type referred to by the target() method.
public final TypeTarget.Usage
usage()

Implements abstract org.jboss.jandex.TypeTarget.usage.

Returns the kind of usage of this type target.
Inherited from org.jboss.jandex.PositionBasedTypeTarget:
position

Constructor Detail

ClassExtendsTypeTargetback to summary
pack-priv ClassExtendsTypeTarget(ClassInfo enclosingTarget, int position)
ClassExtendsTypeTargetback to summary
public ClassExtendsTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)

Method Detail

asClassExtendsback to summary
public ClassExtendsTypeTarget asClassExtends()

Overrides org.jboss.jandex.TypeTarget.asClassExtends.

Doc from org.jboss.jandex.TypeTarget.asClassExtends.

Casts and returns this type target as a ClassExtendsTypeTarget. If this type target is not a ClassExtendsTypeTarget, then an exception will be thrown.

Returns:ClassExtendsTypeTarget

an instance of ClassExtendsTypeTarget

Annotations
@Override
enclosingTargetback to summary
public ClassInfo enclosingTarget()

Overrides org.jboss.jandex.TypeTarget.enclosingTarget.

Doc from org.jboss.jandex.TypeTarget.enclosingTarget.

Returns the enclosing target that contains the type referred to by the target() method.

Returns:ClassInfo

the enclosing target

Annotations
@Override
usageback to summary
public final TypeTarget.Usage usage()

Implements abstract org.jboss.jandex.TypeTarget.usage.

Doc from org.jboss.jandex.TypeTarget.usage.

Returns the kind of usage of this type target. This allows a caller to use a switch statement as opposed to getClass() comparisons.

Returns:TypeTarget.Usage

the kind of usage of this type target

Annotations
@Override