Thread-Safety
This class is immutable and can be shared between threads without safe publication.| Modifier and Type | Field and Description |
|---|---|
| private ClassInfo | |
| private FieldInternal |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final AnnotationInstance | Returns: the annotation instance, ornull if not foundname of the annotation type to look for, must not be name)nullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name)nullImplements org. |
| public final List | Returns: collection of annotation instances, nevernullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name, IndexView nullindex used to obtain the annotation type, must not be index)nullImplements org. |
| public final ClassInfo | asClass()
Implements org. ClassInfo if it is of kind CLASS
|
| public final FieldInfo | asField()
Implements org. FieldInfo if it is of kind FIELD
|
| public final MethodInfo | asMethod()
Implements org. MethodInfo if it is of kind METHOD
|
| public final MethodParameterInfo | asMethodParameter()
Implements org. MethodParameterInfo if it is of kind METHOD_PARAMETER
|
| public final RecordComponentInfo | asRecordComponent()
Implements org. RecordComponentInfo if it is of kind RECORD_COMPONENT
|
| public final TypeTarget | asType()
Implements org. TypeTarget if it is of kind TYPE
|
| public static FieldInfo | |
| public final AnnotationInstance | Returns: the annotation instance, ornull if not foundname of the annotation type to look for, must not be name)nullImplements org. |
| public final List | Returns: list of annotation instances, nevernullImplements org. |
| public final List | Returns: list of annotation instances, nevernullname of the annotation type, must not be name, IndexView nullindex used to obtain the annotation type, must not be index)nullImplements org. |
| public final ClassInfo | |
| public String | Returns: the bytecode descriptor of this fielda substitution function from type variable identifiers to types typeVariableSubstitution)Implements org. |
| public int | Returns: ordinal of this enum constant, or -1 if this field is not an enum constantReturns an ordinal of this enum constant, that is, the zero-based position in the enum declaration. |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| pack-priv FieldInternal | |
| public final short | |
| public String | Returns: a generic signature of this field with type variables substituted, nevernulla substitution function from type variable identifiers to types typeVariableSubstitution)Implements org. |
| public final boolean | Returns: true if the annotation is present, false otherwisename of the annotation type to look for, must not be name)nullImplements org. |
| public final boolean | Returns: true if the annotation is present, false otherwisename of the annotation type to look for, must not be name)nullImplements org. |
| public int | |
| public final boolean | Returns: true if the field is declared as an element of an enum, false otherwiseReturns whether this field is declared as an element of an enum. |
| public final boolean | |
| public final AnnotationTarget. | kind()
Implements org. |
| public final String | |
| public boolean | Returns: whether this field must have a generic signatureImplements org. |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public String | Returns: a string representation of this fieldOverrides java. |
| public final Type |
| clazz | back to summary |
|---|---|
| private ClassInfo clazz | |
| internal | back to summary |
|---|---|
| private FieldInternal internal | |
| FieldInfo | back to summary |
|---|---|
| pack-priv FieldInfo() | |
| FieldInfo | back to summary |
|---|---|
| pack-priv FieldInfo(ClassInfo clazz, FieldInternal internal) | |
| FieldInfo | back to summary |
|---|---|
| pack-priv FieldInfo(ClassInfo clazz, byte[] name, Type type, short flags) | |
| annotation | back to summary |
|---|---|
| public final AnnotationInstance annotation(DotName name) Implements org. Returns the annotation instance with given name declared on this field or any type within its signature.
The The following is a non-exhaustive list of examples of annotations returned by this method: @MyFieldAnnotation public String foo; public List<@MyTypeAnnotation String> bar;
In case an annotation with given name occurs more than once, the result of this method is not deterministic.
For such situations,
| |
| annotations | back to summary |
|---|---|
| public final List Implements org. Returns the annotation instances with given name declared on this field or any type within its signature.
The The following is a non-exhaustive list of examples of annotations returned by this method: @MyFieldAnnotation public String foo; public List<@MyTypeAnnotation String> bar;
| |
| annotations | back to summary |
|---|---|
| public final List Implements org. Returns the annotation instances declared on this field or any type within its signature.
The The following is a non-exhaustive list of examples of annotations returned by this method: @MyFieldAnnotation public String foo; public List<@MyTypeAnnotation String> bar;
| |
| annotationsWithRepeatable | back to summary |
|---|---|
| public final List Implements org. Returns the annotation instances with given name declared on this field or any type within its signature.
The
If the specified annotation is repeatable, the result also contains all values from the container annotation
instance. In this case, the
| |
| asClass | back to summary |
|---|---|
| public final ClassInfo asClass() Implements org. Doc from org. Casts and returns this target as a | |
| asField | back to summary |
|---|---|
| public final FieldInfo asField() Implements org. Doc from org. Casts and returns this target as a | |
| asMethod | back to summary |
|---|---|
| public final MethodInfo asMethod() Implements org. Doc from org. Casts and returns this target as a
| |
| asMethodParameter | back to summary |
|---|---|
| public final MethodParameterInfo asMethodParameter() Implements org. Doc from org. Casts and returns this target as a
| |
| asRecordComponent | back to summary |
|---|---|
| public final RecordComponentInfo asRecordComponent() Implements org. Doc from org. Casts and returns this target as a
| |
| asType | back to summary |
|---|---|
| public final TypeTarget asType() Implements org. Doc from org. Casts and returns this target as a
| |
| create | back to summary |
|---|---|
| public static FieldInfo create(ClassInfo clazz, String name, Type type, short flags) Construct a new mock Field instance. | |
| declaredAnnotation | back to summary |
|---|---|
| public final AnnotationInstance declaredAnnotation(DotName name) Implements org. Returns the annotation instance with given name declared on this field.
Unlike
| |
| declaredAnnotations | back to summary |
|---|---|
| public final List Implements org. Returns the annotation instances declared on this field.
Unlike
| |
| declaredAnnotationsWithRepeatable | back to summary |
|---|---|
| public final List Implements org. Returns the annotation instances with given name declared on this field.
If the specified annotation is repeatable, the result also contains all values from the container annotation
instance. In this case, the
Unlike
| |
| declaringClass | back to summary |
|---|---|
| public final ClassInfo declaringClass() Returns the class which declared the field
| |
| descriptor | back to summary |
|---|---|
| public String descriptor(Function<String, Type> typeVariableSubstitution) Implements org. Returns a bytecode descriptor of this field.
Descriptors of type variables are substituted for descriptors of types provided by the substitution
function Note that the return value does not come directly from bytecode. Jandex does not store the descriptor strings. Instead, the return value is reconstructed from the Jandex object model.
| |
| enumConstantOrdinal | back to summary |
|---|---|
| public int enumConstantOrdinal() Returns an ordinal of this enum constant, that is, the zero-based position in the enum declaration. This is currently very inefficient (requires traversing fields of the declaring class), but may be improved in the future. If this field is not an enum constant, returns -1. Note that for the result to actually be the ordinal value, the index must be produced by at least Jandex 2.4. Previous Jandex versions do not store field positions. At most 256 fields may be present in the class; if there's more, outcome is undefined. This also assumes that the bytecode order corresponds to declaration order, which is not guaranteed, but practically always holds.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| fieldInternal | back to summary |
|---|---|
| pack-priv FieldInternal fieldInternal() | |
| flags | back to summary |
|---|---|
| public final short flags() Returns the access fields of this field.
| |
| genericSignature | back to summary |
|---|---|
| public String genericSignature(Function<String, Type> typeVariableSubstitution) Implements org. Returns a generic signature of this field, possibly without any generic-related information. That is, produces a correct generic signature even if this field does not use any type variables.
Signatures of type variables are substituted for signatures of types provided by the substitution
function Note that the return value does not come directly from bytecode. Jandex does not store the signature strings. Instead, the return value is reconstructed from the Jandex object model. | |
| hasAnnotation | back to summary |
|---|---|
| public final boolean hasAnnotation(DotName name) Implements org. Returns whether an annotation instance with given name is declared on this field or any type within its signature.
| |
| hasDeclaredAnnotation | back to summary |
|---|---|
| public final boolean hasDeclaredAnnotation(DotName name) Implements org. Returns whether an annotation instance with given name is declared on this field.
Unlike
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isEnumConstant | back to summary |
|---|---|
| public final boolean isEnumConstant() Returns whether this field is declared as an element of an enum.
| |
| isSynthetic | back to summary |
|---|---|
public final boolean isSynthetic()
| |
| kind | back to summary |
|---|---|
| public final AnnotationTarget. Implements org. Doc from org. Returns the kind of object this target represents.
| |
| name | back to summary |
|---|---|
| public final String name() Returns the local name of the field
| |
| requiresGenericSignature | back to summary |
|---|---|
| public boolean requiresGenericSignature() Implements org. Returns whether this field must have a generic signature. That is, whether the Java compiler
when compiling this field had to emit the
| |
| setAnnotations | back to summary |
|---|---|
| pack-priv void setAnnotations(List<AnnotationInstance> annotations) | |
| setClassInfo | back to summary |
|---|---|
| pack-priv void setClassInfo(ClassInfo clazz) | |
| setFieldInternal | back to summary |
|---|---|
| pack-priv void setFieldInternal(FieldInternal internal) | |
| setType | back to summary |
|---|---|
| pack-priv void setType(Type type) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation describing this field. It is similar although not necessarily identical to a Java source code declaration of this field.
| |
| type | back to summary |
|---|---|
| public final Type type() Returns the
| |