public class BasicField extends java.lang.Object implements Field
Modifier and Type | Field and Description |
---|---|
protected BasicTypeDataBase |
db |
protected Type |
type |
Constructor and Description |
---|
BasicField(BasicTypeDataBase db,
Type containingType,
java.lang.String name,
Type type,
boolean isStatic,
long offsetInBytes,
Address staticFieldAddress)
offsetInBytes is ignored if the field is static;
staticFieldAddress is used only if the field is static.
|
BasicField(Field fld) |
Modifier and Type | Method and Description |
---|---|
Address |
getAddress() |
Address |
getAddress(Address addr) |
long |
getCInteger(Address addr,
CIntegerType type) |
long |
getCInteger(CIntegerType type) |
boolean |
getJBoolean()
These accessors require that the field be static; otherwise,
a WrongTypeException will be thrown.
|
boolean |
getJBoolean(Address addr)
These accessors require that the field be nonstatic;
otherwise, a WrongTypeException will be thrown.
|
byte |
getJByte() |
byte |
getJByte(Address addr) |
char |
getJChar() |
char |
getJChar(Address addr) |
double |
getJDouble() |
double |
getJDouble(Address addr) |
float |
getJFloat() |
float |
getJFloat(Address addr) |
int |
getJInt() |
int |
getJInt(Address addr) |
long |
getJLong() |
long |
getJLong(Address addr) |
short |
getJShort() |
short |
getJShort(Address addr) |
java.lang.String |
getName()
Get the name of this field
|
OopHandle |
getNarrowOopHandle() |
OopHandle |
getNarrowOopHandle(Address addr) |
long |
getOffset()
The offset of this field, in bytes, in its containing data
structure, if nonstatic.
|
OopHandle |
getOopHandle() |
OopHandle |
getOopHandle(Address addr) |
long |
getSize()
Get the size, in bytes, of this field.
|
Address |
getStaticFieldAddress()
The address of this field, if it is a static field.
|
Type |
getType()
Get the type of this field
|
boolean |
isStatic()
Is this a static field?
|
protected BasicTypeDataBase db
protected Type type
public BasicField(Field fld)
public BasicField(BasicTypeDataBase db, Type containingType, java.lang.String name, Type type, boolean isStatic, long offsetInBytes, Address staticFieldAddress)
public java.lang.String getName()
Field
public long getSize()
Field
public boolean isStatic()
Field
public long getOffset() throws WrongTypeException
Field
getOffset
in interface Field
WrongTypeException
public Address getStaticFieldAddress() throws WrongTypeException
Field
getStaticFieldAddress
in interface Field
WrongTypeException
public boolean getJBoolean(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
Field
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
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public byte getJByte(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJByte
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public char getJChar(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJChar
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public double getJDouble(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJDouble
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public float getJFloat(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJFloat
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public int getJInt(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJInt
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public long getJLong(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJLong
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public short getJShort(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJShort
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public long getCInteger(Address addr, CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getCInteger
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public Address getAddress(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getAddress
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public OopHandle getOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getOopHandle
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
NotInHeapException
public OopHandle getNarrowOopHandle(Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getNarrowOopHandle
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
NotInHeapException
public boolean getJBoolean() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
Field
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".
getJBoolean
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public byte getJByte() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJByte
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public char getJChar() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJChar
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public double getJDouble() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJDouble
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public float getJFloat() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJFloat
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public int getJInt() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJInt
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public long getJLong() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJLong
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public short getJShort() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getJShort
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public long getCInteger(CIntegerType type) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getCInteger
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public Address getAddress() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException
getAddress
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
public OopHandle getOopHandle() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getOopHandle
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
NotInHeapException
public OopHandle getNarrowOopHandle() throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException
getNarrowOopHandle
in interface Field
UnmappedAddressException
UnalignedAddressException
WrongTypeException
NotInHeapException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.