Interface JavaField
- All Superinterfaces:
JavaMember
- All Known Implementing Classes:
DTFJJavaField, DTFJJavaFieldInstance, DTFJJavaFieldStatic, JavaField, JavaInstanceField, JavaStaticField
Represents a Java field declaration.
This interface is modeled on java.lang.reflect.Field.
-
Method Summary
Modifier and TypeMethodDescriptionget(JavaObject object) Get the contents of an Object field.booleangetBoolean(JavaObject object) Get the contents of a boolean field.bytegetByte(JavaObject object) Get the contents of a byte field.chargetChar(JavaObject object) Get the contents of a char field.doublegetDouble(JavaObject object) Get the contents of a double field.floatgetFloat(JavaObject object) Get the contents of a float field.intgetInt(JavaObject object) Get the contents of an int field.longgetLong(JavaObject object) Get the contents of a long field.shortgetShort(JavaObject object) Get the contents of a short field.getString(JavaObject object) Get the contents of a string field.default booleanDeprecated.default booleanDeprecated.Methods declared in interface JavaMember
equals, getDeclaringClass, getModifiers, getName, getSignature, hashCodeModifier and TypeMethodDescriptionbooleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.Get the class which declares this field or methodintGet the set of modifiers for this field or method - a set of bitsgetName()Get the name of the field or methodGet the signature of the field or methodinthashCode()Answers an integer hash code for the receiver.
-
Method Details
-
get
Get the contents of an Object field.- Parameters:
object- to fetch the field from. Ignored for static fields.- 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 This field must be declared in the object's class or in a superclass.
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field- See Also:
-
getBoolean
Get the contents of a boolean field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to boolean
-
getByte
Get the contents of a byte field.- Parameters:
object- to fetch the field from. Ignored for static fields- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to byte
-
getChar
Get the contents of a char field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to char
-
getDouble
Get the contents of a double field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to double
-
getFloat
Get the contents of a float field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to float
-
getInt
Get the contents of an int field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to int
-
getLong
Get the contents of a long field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to long
-
getShort
Get the contents of a short field.- Parameters:
object- to fetch the field from. Ignored for static fields.- Returns:
- the field contents
- Throws:
CorruptDataExceptionMemoryAccessExceptionNullPointerException- if the field is an instance field, and object is nullIllegalArgumentException- if the specified object is not appropriate for this field, or if the type of the field cannot be converted to short
-
getString
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:
CorruptDataExceptionMemoryAccessExceptionIllegalArgumentException- if the specified field is not a StringNullPointerException- if the field is an instance field, and object is null
-
isNestedPacked
Deprecated. -
isNestedPackedArray
@Deprecated default boolean isNestedPackedArray() throws CorruptDataException, MemoryAccessExceptionDeprecated.
-