APIdia Launch Partner
Top Fields Constructors Methods
com.sun.tools.jdi

public Class FieldImpl

extends TypeComponentImpl
implements Field, ValueContainer
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdi.ValueContainer, com.sun.jdi.Field, java.lang.Comparable, com.sun.jdi.TypeComponent, com.sun.jdi.Accessible, com.sun.jdi.Mirror
Imports
com.sun.jdi.ClassNotLoadedException, .Field, .Type, .VirtualMachine

Field Summary

Inherited from com.sun.tools.jdi.TypeComponentImpl:
declaringTypegenericSignaturenamerefsignature

Constructor Summary

AccessConstructor and Description
pack-priv
FieldImpl(VirtualMachine vm, ReferenceTypeImpl declaringType, long ref, String name, String signature, String genericSignature, int modifiers)

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(Field field)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public boolean
equals(Object obj)

Overrides com.sun.tools.jdi.MirrorImpl.equals.

Implements com.sun.jdi.Field.equals.

Compares the specified Object with this field for equality.

public Type
public int
hashCode()

Overrides com.sun.tools.jdi.MirrorImpl.hashCode.

Implements com.sun.jdi.Field.hashCode.

Returns the hash code value for this Field.

public boolean
isEnumConstant()

Implements com.sun.jdi.Field.isEnumConstant.

Determine if this is a field that represents an enum constant.

public boolean
isTransient()

Implements com.sun.jdi.Field.isTransient.

Determine if this is a transient field.

public boolean
isVolatile()

Implements com.sun.jdi.Field.isVolatile.

Determine if this is a volatile field.

public String
toString()

Overrides java.lang.Object.toString.

Implements com.sun.jdi.Mirror.toString.

Returns a String describing this mirror

public Type
type()

Implements com.sun.jdi.Field.type, com.sun.tools.jdi.ValueContainer.type.

Returns the type of this field.

public String

Returns:

a text representation of the declared type of this field.
typeName
()

Implements com.sun.jdi.Field.typeName, com.sun.tools.jdi.ValueContainer.typeName.

Returns a text representation of the type of this field.

Inherited from com.sun.tools.jdi.TypeComponentImpl:
declaringTypegenericSignatureisFinalisModifierSetisPackagePrivateisPrivateisProtectedisPublicisStaticisSyntheticmodifiersnamerefsignature

Constructor Detail

FieldImplback to summary
pack-priv FieldImpl(VirtualMachine vm, ReferenceTypeImpl declaringType, long ref, String name, String signature, String genericSignature, int modifiers)

Method Detail

compareToback to summary
public int compareTo(Field field)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

equalsback to summary
public boolean equals(Object obj)

Overrides com.sun.tools.jdi.MirrorImpl.equals.

Implements com.sun.jdi.Field.equals.

Doc from com.sun.jdi.Field.equals.

Compares the specified Object with this field for equality.

findTypeback to summary
public Type findType(String signature) throws ClassNotLoadedException

Implements com.sun.tools.jdi.ValueContainer.findType.

hashCodeback to summary
public int hashCode()

Overrides com.sun.tools.jdi.MirrorImpl.hashCode.

Implements com.sun.jdi.Field.hashCode.

Doc from com.sun.jdi.Field.hashCode.

Returns the hash code value for this Field.

Annotations
@Override
isEnumConstantback to summary
public boolean isEnumConstant()

Implements com.sun.jdi.Field.isEnumConstant.

Doc from com.sun.jdi.Field.isEnumConstant.

Determine if this is a field that represents an enum constant.

isTransientback to summary
public boolean isTransient()

Implements com.sun.jdi.Field.isTransient.

Doc from com.sun.jdi.Field.isTransient.

Determine if this is a transient field.

isVolatileback to summary
public boolean isVolatile()

Implements com.sun.jdi.Field.isVolatile.

Doc from com.sun.jdi.Field.isVolatile.

Determine if this is a volatile field.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Implements com.sun.jdi.Mirror.toString.

Doc from com.sun.jdi.Mirror.toString.

Returns a String describing this mirror

typeback to summary
public Type type() throws ClassNotLoadedException

Implements com.sun.jdi.Field.type, com.sun.tools.jdi.ValueContainer.type.

Doc from com.sun.jdi.Field.type.

Returns the type of this field. Where the type is the type specified in the declaration of this field.

For example, if a target class defines:

   short s;
   Date d;
   byte[] ba;
And the JDI client defines these Field objects:
   Field sField = targetClass.fieldByName("s");
   Field dField = targetClass.fieldByName("d");
   Field baField = targetClass.fieldByName("ba");
to mirror the corresponding fields, then sField.type() is a ShortType, dField.type() is the ReferenceType for java.util.Date and ((ArrayType)(baField.type())).componentType() is a ByteType.

Note

if the type of this field is a reference type (class, interface, or array) and it has not been created or loaded by the declaring type's class loader - that is, declaringType() .classLoader(), then ClassNotLoadedException will be thrown. Also, a reference type may have been loaded but not yet prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()) will throw a ClassNotPreparedException. Use ReferenceType#isPrepared() to determine if a reference type is prepared.

Exceptions
ClassNotLoadedException:
if the type has not yet been loaded or created through the appropriate class loader.
typeNameback to summary
public String typeName()

Implements com.sun.jdi.Field.typeName, com.sun.tools.jdi.ValueContainer.typeName.

Doc from com.sun.jdi.Field.typeName.

Returns a text representation of the type of this field. Where the type is the type specified in the declaration of this field.

This type name is always available even if the type has not yet been created or loaded.

Returns:String

a text representation of the declared type of this field.