public class ClassExtendsTypeTarget extends PositionBasedTypeTarget
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 return a position of 1 (marking the first interface), an enclosing target of the
ClassInfo
representing "Foo", and a target type of the type variable "T".TypeTarget.Usage
AnnotationTarget.Kind
Constructor and Description |
---|
ClassExtendsTypeTarget(AnnotationTarget enclosingTarget,
Type target,
int position) |
Modifier and Type | Method and Description |
---|---|
ClassExtendsTypeTarget |
asClassExtends()
Casts and returns this type target as a
ClassExtendsTypeTarget . |
ClassInfo |
enclosingTarget()
Returns the enclosing target that contains the type referred to by the
TypeTarget.target() method. |
TypeTarget.Usage |
usage()
Returns the kind of usage of this type target.
|
position
asClass, asEmpty, asField, asMethod, asMethodParameter, asMethodParameterType, asThrows, asType, asTypeParameter, asTypeParameterBound, kind, target
public ClassExtendsTypeTarget(AnnotationTarget enclosingTarget, Type target, int position)
public final TypeTarget.Usage usage()
TypeTarget
getClass()
comparisons.usage
in class TypeTarget
public ClassInfo enclosingTarget()
TypeTarget
TypeTarget.target()
method.enclosingTarget
in class TypeTarget
public ClassExtendsTypeTarget asClassExtends()
TypeTarget
ClassExtendsTypeTarget
. If this type target
is not a ClassExtendsTypeTarget
, then an exception will be thrown.asClassExtends
in class TypeTarget
ClassExtendsTypeTarget
Copyright © 2018 JBoss by Red Hat. All rights reserved.