public class Field extends Location implements AttrContainer, Member
| Constructor and Description |
|---|
Field(ClassType ctype)
Add a new Field to a ClassType.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> clas) |
Attribute |
getAttributes()
Get the (first) Attribute of this container.
|
ConstantPool |
getConstants() |
ClassType |
getDeclaringClass() |
int |
getFlags() |
int |
getModifiers() |
Field |
getNext() |
java.lang.reflect.Field |
getReflectField() |
java.lang.String |
getSourceName() |
boolean |
getStaticFlag() |
Type |
getType() |
boolean |
hasConstantValueAttr() |
static Field |
searchField(Field fields,
java.lang.String name)
Find a field with the given name.
|
void |
setAttributes(Attribute attributes)
Set the (list of) Attributes of this container.
|
void |
setConstantValue(java.lang.Object value,
ClassType ctype)
Set the ConstantValue attribute for this field.
|
void |
setModifiers(int modifiers) |
void |
setSourceName(java.lang.String name) |
void |
setStaticFlag(boolean is_static) |
java.lang.String |
toString() |
getName, getSignature, setName, setName, setSignature, setTypepublic Field(ClassType ctype)
public final Attribute getAttributes()
AttrContainergetAttributes in interface AttrContainerpublic final void setAttributes(Attribute attributes)
AttrContainersetAttributes in interface AttrContainerpublic final ClassType getDeclaringClass()
getDeclaringClass in interface Memberpublic final ConstantPool getConstants()
getConstants in interface AttrContainerpublic final void setStaticFlag(boolean is_static)
public final boolean getStaticFlag()
getStaticFlag in interface Memberpublic final int getFlags()
public final int getModifiers()
getModifiers in interface Memberpublic final void setModifiers(int modifiers)
public java.lang.reflect.Field getReflectField()
throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldExceptionpublic <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> clas)
public void setSourceName(java.lang.String name)
public java.lang.String getSourceName()
public static Field searchField(Field fields, java.lang.String name)
fields - list of fields to searchname - (interned source) name of field to look forpublic final Field getNext()
public final void setConstantValue(java.lang.Object value,
ClassType ctype)
value - the value to use for the ConstantValue attribute
of this fieldctype - the class that contains this field
This field's type is used to determine the kind of constant.public boolean hasConstantValueAttr()
public java.lang.String toString()
toString in class java.lang.Object