|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HField
A HField
provides information about a single field of a class
or an interface. The reflected field may be a class (static) field or
an instance field.
HMember
,
HClass
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface harpoon.ClassFile.HMember |
---|
HMember.MemberComparator |
Field Summary | |
---|---|
static ArrayFactory<HField> |
arrayFactory
Array factory: returns new HField[] . |
Fields inherited from interface harpoon.ClassFile.HMember |
---|
memberComparator |
Method Summary | |
---|---|
boolean |
equals(Object object)
Compares this HField against the specified object. |
Object |
getConstant()
Returns the constant value of this HField , if
it is a constant field. |
HClass |
getDeclaringClass()
Returns the HClass object representing the class or
interface that declares the field represented by this
HField object. |
String |
getDescriptor()
Return the type descriptor for this HField
object. |
HType |
getGenericType()
Returns an HType object that represents the declared
compile-time type for the field represented by this
HField object. |
int |
getModifiers()
Returns the Java language modifiers for the field represented by this HField object, as an integer. |
HFieldMutator |
getMutator()
Returns a mutator for this HField , or null
if the object is immutable. |
String |
getName()
Returns the name of the field represented by this HField object. |
HClass |
getType()
Returns an HClass object that identifies the declared
type for the field represented by this HField object. |
boolean |
isConstant()
Determines whether this HField represents a constant
field. |
boolean |
isStatic()
Determines whether this is a static field. |
boolean |
isSynthetic()
Determines whether this HField is synthetic. |
String |
toString()
Return a string describing this HField . |
Methods inherited from interface harpoon.ClassFile.HMember |
---|
compareTo, hashCode |
Field Detail |
---|
static final ArrayFactory<HField> arrayFactory
HField[]
.
Method Detail |
---|
HClass getDeclaringClass()
HClass
object representing the class or
interface that declares the field represented by this
HField
object.
getDeclaringClass
in interface HMember
String getName()
HField
object.
getName
in interface HMember
int getModifiers()
HField
object, as an integer. The Modifier
class should be used to decode the modifiers.
getModifiers
in interface HMember
Modifier
HClass getType()
HClass
object that identifies the declared
type for the field represented by this HField
object.
String getDescriptor()
HField
object. The format of a field string descriptor is defined in Section
4.3 of the JVM specification.
getDescriptor
in interface HMember
Object getConstant()
HField
, if
it is a constant field.
null
if
!isConstant()
.HClass.getWrapper(harpoon.ClassFile.Linker)
boolean isConstant()
HField
represents a constant
field.
boolean isSynthetic()
HField
is synthetic.
isSynthetic
in interface HMember
boolean isStatic()
HFieldMutator getMutator()
HField
, or null
if the object is immutable.
boolean equals(Object object)
HField
against the specified object.
Returns true
if the objects are the same. Two
HFields
are the same if they were declared by the same
class and have the same name and type.
equals
in class Object
String toString()
HField
. The format
is the access modifiers for the field, if any, followed by the
field type, followed by a space, followed by the fully-qualified
name of the class declaring the field, followed by a period,
followed by the name of the field. For example:
public static final int java.lang.Thread.MIN_PRIORITY
private int java.io.FileDescriptor.fd
The modifiers are placed in canonical order as specified by
"The Java Language Specification." This is
public
, protected
, or private
first, and then other modifiers in the following order:
static
, final
, transient
,
volatile
.
toString
in class Object
HType getGenericType()
HType
object that represents the declared
compile-time type for the field represented by this
HField
object. In particular, if the compile-time
type of this field is a type variable or a parameterized type,
than an object of the appropriate type (i.e.,
HTypeVariable
or HParameterizedType
)
will be returned.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |