This is the basic interface which describes a field in a C/C++ data structure or a Java object.
The accessors in this class are designed to allow manual coercion of the data within the field, which is often necessary when interfacing with C programs. Therefore, the accessors here do not perform any type checking. Specializations of the Field interface, such as JByteField, provide getValue() methods which both perform type checking and return the appropriate specialized type.
See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType".
As an example, coercing a pointer field into an int can be done in the following fashion (assuming the application has registered an integer type in the type database called "intptr_t"):
{
...
Address myObject = ...;
CIntegerType intptr_tType = (CIntegerType) db.lookupType("intptr_t");
long addrVal = field.getCInteger(myObject, intptr_tType);
...
}
FIXME: among other things, this interface is not sufficient to
describe fields which are themselves arrays (like Symbol's
u1 _body[1]).
| Modifier and Type | Method and Description |
|---|---|
| public Address | |
| public Address | |
| public long | |
| public long | |
| public boolean | getJBoolean(Address addr)
These accessors require that the field be nonstatic; otherwise, a WrongTypeException will be thrown. |
| public boolean | getJBoolean()
These accessors require that the field be static; otherwise, a WrongTypeException will be thrown. |
| public byte | |
| public byte | |
| public char | |
| public char | |
| public double | |
| public double | |
| public float | |
| public float | |
| public int | |
| public int | |
| public long | |
| public long | |
| public short | |
| public short | |
| public String | |
| public OopHandle | |
| public OopHandle | |
| public long | |
| public OopHandle | |
| public OopHandle | |
| public long | |
| public Address | |
| public Type | |
| public boolean |
| getAddress | back to summary |
|---|---|
| public Address getAddress(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getAddress | back to summary |
|---|---|
| public Address getAddress() throws UnmappedAddressException, UnalignedAddressException | |
| getCInteger | back to summary |
|---|---|
| public long getCInteger(Address addr, CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getCInteger | back to summary |
|---|---|
| public long getCInteger(CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJBoolean | back to summary |
|---|---|
| public boolean getJBoolean(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException These accessors require that the field be nonstatic; otherwise, a WrongTypeException will be thrown. Note that type checking is not performed by these accessors in order to allow manual type coercion of field data. For better protection when accessing primitive fields, use the get(Type)Field accessors in Type.java. NOTE that the Address passed in to these routines may, in fact, be an OopHandle. Specifically, in a reflective system, dereferencing operations applied to the OopHandle must be performed atomically with respect to GC. See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType". | |
| getJBoolean | back to summary |
|---|---|
| public boolean getJBoolean() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException These accessors require that the field be static; otherwise, a WrongTypeException will be thrown. Note that type checking is not performed by these accessors in order to allow manual type coercion of field data. For better protection when accessing primitive fields, use the get(Type)Field accessors in Type.java. NOTE that the Address passed in to these routines may, in fact, be an OopHandle. Specifically, in a reflective system, dereferencing operations applied to the OopHandle must be performed atomically with respect to GC. See @see CIntegerType for a description of why all C integer types are bundled into the category "CIntegerType". | |
| getJByte | back to summary |
|---|---|
| public byte getJByte(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJByte | back to summary |
|---|---|
| public byte getJByte() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJChar | back to summary |
|---|---|
| public char getJChar(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJChar | back to summary |
|---|---|
| public char getJChar() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJDouble | back to summary |
|---|---|
| public double getJDouble(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJDouble | back to summary |
|---|---|
| public double getJDouble() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJFloat | back to summary |
|---|---|
| public float getJFloat(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJFloat | back to summary |
|---|---|
| public float getJFloat() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJInt | back to summary |
|---|---|
| public int getJInt(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJInt | back to summary |
|---|---|
| public int getJInt() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJLong | back to summary |
|---|---|
| public long getJLong(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJLong | back to summary |
|---|---|
| public long getJLong() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJShort | back to summary |
|---|---|
| public short getJShort(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getJShort | back to summary |
|---|---|
| public short getJShort() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException | |
| getName | back to summary |
|---|---|
| public String getName() Get the name of this field | |
| getNarrowOopHandle | back to summary |
|---|---|
| public OopHandle getNarrowOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException | |
| getNarrowOopHandle | back to summary |
|---|---|
| public OopHandle getNarrowOopHandle() throws UnmappedAddressException, UnalignedAddressException, NotInHeapException | |
| getOffset | back to summary |
|---|---|
| public long getOffset() throws WrongTypeException The offset of this field, in bytes, in its containing data structure, if nonstatic. If this is a static field, throws a WrongTypeException. | |
| getOopHandle | back to summary |
|---|---|
| public OopHandle getOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException | |
| getOopHandle | back to summary |
|---|---|
| public OopHandle getOopHandle() throws UnmappedAddressException, UnalignedAddressException, NotInHeapException | |
| getSize | back to summary |
|---|---|
| public long getSize() Get the size, in bytes, of this field. Used for manual data structure traversal where necessary. | |
| getStaticFieldAddress | back to summary |
|---|---|
| public Address getStaticFieldAddress() throws WrongTypeException The address of this field, if it is a static field. If this is a nonstatic field, throws a WrongTypeException. | |
| getType | back to summary |
|---|---|
| public Type getType() Get the type of this field | |
| isStatic | back to summary |
|---|---|
| public boolean isStatic() Is this a static field? | |