| 1 |
package jakarta.enterprise.lang.model.declarations; |
| 2 |
|
| 3 |
import jakarta.enterprise.lang.model.types.Type; |
| 4 |
|
| 5 |
/** |
| 6 |
* A field, {@linkplain #declaringClass() declared} in some class. |
| 7 |
* |
| 8 |
* @since 4.0 |
| 9 |
*/ |
| 10 |
public interface FieldInfo extends DeclarationInfo { |
| 11 |
/** |
| 12 |
* Returns the name of this field. |
| 13 |
* |
| 14 |
* @return the name of this field, never {@code null} |
| 15 |
*/ |
| 16 |
String name(); |
| 17 |
|
| 18 |
/** |
| 19 |
* Returns the {@linkplain Type type} of this field. |
| 20 |
* |
| 21 |
* @return the {@linkplain Type type} of this field, never {@code null} |
| 22 |
*/ |
| 23 |
Type type(); |
| 24 |
|
| 25 |
/** |
| 26 |
* Returns whether this field is {@code static}. |
| 27 |
* |
| 28 |
* @return whether this field is {@code static}. |
| 29 |
*/ |
| 30 |
boolean isStatic(); |
| 31 |
|
| 32 |
/** |
| 33 |
* Returns whether this field is {@code final}. |
| 34 |
* |
| 35 |
* @return whether this field is {@code final}. |
| 36 |
*/ |
| 37 |
boolean isFinal(); |
| 38 |
|
| 39 |
/** |
| 40 |
* Returns the modifiers of this field as an {@code int}. |
| 41 |
* Use {@link java.lang.reflect.Modifier Modifier} to inspect the value. |
| 42 |
* |
| 43 |
* @return the modifiers of this field |
| 44 |
*/ |
| 45 |
int modifiers(); |
| 46 |
|
| 47 |
/** |
| 48 |
* Returns the {@linkplain ClassInfo class} that declares this field. |
| 49 |
* |
| 50 |
* @return the {@linkplain ClassInfo class} that declares this field, never {@code null} |
| 51 |
*/ |
| 52 |
ClassInfo declaringClass(); |
| 53 |
|
| 54 |
// --- |
| 55 |
|
| 56 |
@Override |
| 57 |
default Kind kind() { |
| 58 |
return Kind.FIELD; |
| 59 |
} |
| 60 |
|
| 61 |
@Override |
| 62 |
default FieldInfo asField() { |
| 63 |
return this; |
| 64 |
} |
| 65 |
} |