javax.tools.diagnostics.runtime.java
Interface JavaField

All Superinterfaces:
JavaMember

public interface JavaField
extends JavaMember

Represents a field declaration. It is modelled on Field


Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object get(JavaObject object)
           Get the contents of a field of an Object.
 boolean getBoolean(JavaObject object)
           Get the contents of a boolean field
 byte getByte(JavaObject object)
           Get the contents of a byte field
 char getChar(JavaObject object)
           Get the contents of a char field
 double getDouble(JavaObject object)
           Get the contents of a double field or of another primitive field whose type is convertible to double via a widening conversion.
 float getFloat(JavaObject object)
           Get the contents of a float field or of another primitive field whose type is convertible to float via a widening conversion.
 int getInt(JavaObject object)
           Get the contents of an int field or of another primitive field whose type is convertible to int via a widening conversion.
 long getLong(JavaObject object)
           Get the contents of a long field or of another primitive field whose type is convertible to long via a widening conversion.
 short getShort(JavaObject object)
           Get the contents of a short field or of another primitive field whose type is convertible to short via a widening conversion.
 java.lang.String getString(JavaObject object)
           Get the contents of a string field
 int hashCode()
           
 
Methods inherited from interface javax.tools.diagnostics.runtime.java.JavaMember
getDeclaringClass, getModifiers, getName, getSignature
 

Method Detail

get

java.lang.Object get(JavaObject object)
                     throws CorruptDataException,
                            MemoryAccessException

Get the contents of a field of an Object.

Parameters:
object - to fetch the field from. Ignored for static fields.

This field must be declared in the object's class or in a superclass

Returns:
a JavaObject instance for reference type fields, an instance of a subclass of Number, Boolean, or Character for primitive fields, or null for null reference fields.
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field
See Also:
JavaObject, Byte, Double, Float, Integer, Long, Short, Character, Boolean

getBoolean

boolean getBoolean(JavaObject object)
                   throws CorruptDataException,
                          MemoryAccessException

Get the contents of a boolean field

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the field is not a boolean.

getByte

byte getByte(JavaObject object)
             throws CorruptDataException,
                    MemoryAccessException

Get the contents of a byte field

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to byte

getChar

char getChar(JavaObject object)
             throws CorruptDataException,
                    MemoryAccessException

Get the contents of a char field

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to char

getDouble

double getDouble(JavaObject object)
                 throws CorruptDataException,
                        MemoryAccessException

Get the contents of a double field or of another primitive field whose type is convertible to double via a widening conversion.

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to double via a widening conversion

getFloat

float getFloat(JavaObject object)
               throws CorruptDataException,
                      MemoryAccessException

Get the contents of a float field or of another primitive field whose type is convertible to float via a widening conversion.

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to float via a widening conversion

getInt

int getInt(JavaObject object)
           throws CorruptDataException,
                  MemoryAccessException

Get the contents of an int field or of another primitive field whose type is convertible to int via a widening conversion.

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to int via a widening conversion.

getLong

long getLong(JavaObject object)
             throws CorruptDataException,
                    MemoryAccessException

Get the contents of a long field or of another primitive field whose type is convertible to long via a widening conversion.

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to long via a widening conversion.

getShort

short getShort(JavaObject object)
               throws CorruptDataException,
                      MemoryAccessException

Get the contents of a short field or of another primitive field whose type is convertible to short via a widening conversion.

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
the field contents
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.NullPointerException - if the field is an instance field, and object is null
java.lang.IllegalArgumentException - if the specified object is not appropriate for this field, or if the type of the field cannot be converted to short via a widening conversion.

getString

java.lang.String getString(JavaObject object)
                           throws CorruptDataException,
                                  MemoryAccessException

Get the contents of a string field

Parameters:
object - to fetch the field from. Ignored for static fields.
Returns:
a String representing the value of the String field. Note that the instance returned can be null if the field was null in object.
Throws:
CorruptDataException - if the underlying data is in an unexpected state
MemoryAccessException
java.lang.IllegalArgumentException - if the specified field is not a String
java.lang.NullPointerException - if the field is an instance field, and object is null

equals

boolean equals(java.lang.Object obj)
Specified by:
equals in interface JavaMember
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True if the given object refers to the same Java Field in the image

hashCode

int hashCode()
Specified by:
hashCode in interface JavaMember
Overrides:
hashCode in class java.lang.Object


Copyright © 2010. All Rights Reserved.