java.lang.Object | ||
↳ | com.sun.tools.jdi.TypeImpl | |
↳ | com.sun.tools.jdi.ReferenceTypeImpl |
Known Direct Subclasses |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
modifiers | |||||||||||
ref |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.sun.tools.jdi.TypeImpl
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a list containing each
Field declared in this type,
and its superclasses, implemented interfaces, and/or superinterfaces. | |||||||||||
Returns a list containing a
Location object
for each executable source line in this reference type. | |||||||||||
Returns a list containing a
Location object
for each executable source line in this reference type. | |||||||||||
Returns a list containing each
Method declared in this type,
and its superclasses, implemented interfaces, and/or superinterfaces. | |||||||||||
Return the available strata for this reference type.
| |||||||||||
Gets the classloader object which loaded the class corresponding
to this type.
| |||||||||||
Returns the class object that corresponds to this type in the
target VM.
| |||||||||||
Returns the raw bytes of the constant pool in the format of the
constant_pool item of the Class File Format in the Java Virtual
Machine Specification.
| |||||||||||
Returns the number of entries in the constant pool plus one.
| |||||||||||
Always returns non-null stratumID
| |||||||||||
Indicates whether some other object is "equal to" this one.
| |||||||||||
Determines if initialization failed for this class.
| |||||||||||
Finds the visible
Field with the given
non-ambiguous name. | |||||||||||
Returns a list containing each
Field declared in this type. | |||||||||||
Gets the generic signature for this type if there is one.
| |||||||||||
Returns a map of field values
| |||||||||||
Returns a hash code value for the object.
| |||||||||||
Returns instances of this ReferenceType.
| |||||||||||
Determines if this type was declared abstract.
| |||||||||||
Determines if this type was declared final.
| |||||||||||
Determines if this type has been initialized.
| |||||||||||
Determines if this object mirrors a package private item.
| |||||||||||
Determines if this type has been prepared.
| |||||||||||
Determines if this object mirrors a private item.
| |||||||||||
Determines if this object mirrors a protected item.
| |||||||||||
Determines if this object mirrors a public item.
| |||||||||||
Determines if this type was declared static.
| |||||||||||
Determines if this type has been verified.
| |||||||||||
Returns a List containing all
Location objects
that map to the given line number. | |||||||||||
Returns a List containing all
Location objects
that map to the given line number. | |||||||||||
Returns the class major version number, as defined in the class file format
of the Java Virtual Machine Specification.
| |||||||||||
Returns a list containing each
Method declared
directly in this type. | |||||||||||
Returns a List containing each visible
Method that
has the given name and signature. | |||||||||||
Returns a List containing each visible
Method that
has the given name. | |||||||||||
Returns the class minor version number, as defined in the class file format
of the Java Virtual Machine Specification.
| |||||||||||
Returns the JavaTM
programming language modifiers, encoded in an integer.
| |||||||||||
Returns a List containing
ReferenceType objects that are
declared within this type and are currently loaded into the Virtual
Machine. | |||||||||||
Returns the JNI-style signature for this type.
| |||||||||||
Get the source debug extension of this type.
| |||||||||||
Gets an identifying name for the source corresponding to the
declaration of this type.
| |||||||||||
Gets the identifying names for all the source corresponding to the
declaration of this type.
| |||||||||||
Gets the paths to the source corresponding to the
declaration of this type.
| |||||||||||
Returns a list containing each unhidden and unambiguous
Field
in this type. | |||||||||||
Returns a list containing each
Method
declared or inherited by this type. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.sun.tools.jdi.TypeImpl
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.sun.jdi.Accessible
| |||||||||||
From interface
com.sun.jdi.Mirror
| |||||||||||
From interface
com.sun.jdi.ReferenceType
| |||||||||||
From interface
com.sun.jdi.Type
| |||||||||||
From interface
java.lang.Comparable
|
Returns a list containing each Field
declared in this type,
and its superclasses, implemented interfaces, and/or superinterfaces.
All declared and inherited
fields are included, regardless of whether they are hidden or
multiply inherited.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Field
objects; the list has length
0 if no fields exist.Returns a list containing a Location
object
for each executable source line in this reference type.
This method is equivalent to
allLineLocations(vm.getDefaultStratum(),null)
-
see allLineLocations(String, String)
for more information.
AbsentInformationException |
---|
Returns a list containing a Location
object
for each executable source line in this reference type.
Each location maps a source line to a range of code
indices.
The beginning of the range can be determined through
codeIndex()
. The returned list may contain
multiple locations for a particular line number, if the
compiler and/or VM has mapped that line to two or more
disjoint code index ranges. Note that it is possible for
the same source line to represent different code index
ranges in different methods.
For arrays (ArrayType
) and primitive classes, the
returned list is always empty. For interfaces (InterfaceType
), the returned list will be non-empty only
if the interface has executable code in its class
initialization.
Returned list is for the specified stratum
(see Location
for a description of strata).
stratumID | The stratum to retrieve information from
or null for the defaultStratum() . |
---|---|
sourceName | Return locations only within this
source file or null to return locations. |
Location
objects.AbsentInformationException |
---|
Returns a list containing each Method
declared in this type,
and its superclasses, implemented interfaces, and/or superinterfaces.
All declared and inherited
methods are included, regardless of whether they are hidden or
overridden.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Method
objects; the list has length
0 if no methods exist.Return the available strata for this reference type.
See the Location
for a description of strata.
java.lang.String
, each
representing a stratumGets the classloader object which loaded the class corresponding to this type.
ClassLoaderReference
which mirrors the classloader,
or null
if the class was loaded through the bootstrap class
loader.
Returns the class object that corresponds to this type in the target VM. The VM creates class objects for every kind of ReferenceType: classes, interfaces, and array types.
ClassObjectReference
for this reference type
in the target VM.
Returns the raw bytes of the constant pool in the format of the
constant_pool item of the Class File Format in the Java Virtual
Machine Specification. The format of the constant pool may
differ between versions of the Class File Format, so, the
minor and major class version numbers should be checked for
compatibility.
For arrays (ArrayType
) and primitive classes,
a zero length byte array is returned.
Not all target virtual machines support this operation.
Use canGetConstantPool()
to determine if the operation is supported.
Returns the number of entries in the constant pool plus one.
This corresponds to the constant_pool_count item of the Class File Format
in the Java Virtual Machine Specification.
For arrays (ArrayType
) and primitive classes,
the returned constant pool count value is zero.
Not all target virtual machines support this operation.
Use canGetConstantPool()
to determine if the operation is supported.
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y) consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
obj | the reference object with which to compare. |
---|
true
if this object is the same as the obj
argument; false
otherwise.Determines if initialization failed for this class. See the JVM specification for details on class initialization.
For arrays (ArrayType
) and primitive classes,
the return value is undefined.
true
if initialization was attempted and
failed; false otherwise.
Finds the visible Field
with the given
non-ambiguous name. This method follows the
inheritance rules specified in the JLS (8.3.3) to determine
visibility.
For arrays (ArrayType
) and primitive classes, the returned
value is always null.
fieldName | a String containing the name of desired field. |
---|
Field
object which mirrors the found field, or
null if there is no field with the given name or if the given
name is ambiguous.Returns a list containing each Field
declared in this type.
Inherited fields are not included. Any synthetic fields created
by the compiler are included in the list.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Field
objects; the list has length 0
if no fields exist.Gets the generic signature for this type if there is one. Generic signatures are described in the "JavaTM Virtual Machine Specification, 3rd Edition.
null
if there is no generic signature.Returns a hash code value for the object. This method is
supported for the benefit of hashtables such as those provided by
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
Returns instances of this ReferenceType. Only instances that are reachable for the purposes of garbage collection are returned.
Not all target virtual machines support this operation.
Use canGetInstanceInfo()
to determine if the operation is supported.
maxInstances | the maximum number of instances to return. Must be non-negative. If zero, all instances are returned. |
---|
ObjectReference
objects. If there are
no instances of this ReferenceType, a zero-length list is returned.Determines if this type was declared abstract.
For arrays (ArrayType
) and primitive classes,
the return value is undefined.
true
if this type is abstract; false otherwise.
Determines if this type was declared final.
For arrays (ArrayType
) and primitive classes,
the return value is always true.
true
if this type is final; false otherwise.
Determines if this type has been initialized. See the JVM
specification for a definition of class verification.
For InterfaceType
, this method always returns the
same value as isPrepared()
.
For arrays (ArrayType
) and primitive classes,
the return value is undefined.
true
if this type is initialized; false otherwise.
Determines if this object mirrors a package private item.
A package private item is declared with no access specifier.
For ArrayType
, the return value depends on the
array component type. For primitive arrays the return value
is always false. For object arrays, the return value is the
same as would be returned for the component type.
For primitive classes, such as TYPE
,
the return value is always false.
true
for items with package private access;
false
otherwise.
Determines if this type has been prepared. See the JVM specification for a definition of class preparation.
For arrays (ArrayType
) and primitive classes,
the return value is undefined.
true
if this type is prepared; false otherwise.
Determines if this object mirrors a private item.
For ArrayType
, the return value depends on the
array component type. For primitive arrays the return value
is always false. For object arrays, the return value is the
same as would be returned for the component type.
For primitive classes, such as TYPE
,
the return value is always false.
true
for items with private access;
false
otherwise.
Determines if this object mirrors a protected item.
For ArrayType
, the return value depends on the
array component type. For primitive arrays the return value
is always false. For object arrays, the return value is the
same as would be returned for the component type.
For primitive classes, such as TYPE
,
the return value is always false.
true
for items with private access;
false
otherwise.
Determines if this object mirrors a public item.
For ArrayType
, the return value depends on the
array component type. For primitive arrays the return value
is always true. For object arrays, the return value is the
same as would be returned for the component type.
For primitive classes, such as TYPE
,
the return value is always true.
true
for items with public access;
false
otherwise.
Determines if this type was declared static. Only nested types,
can be declared static, so false
is returned
for any package-level type, array type, or primitive class.
true
if this type is static; false otherwise.
Determines if this type has been verified. See the JVM specification for a definition of class verification.
For arrays (ArrayType
) and primitive classes,
the return value is undefined.
true
if this type is verified; false otherwise.
Returns a List containing all Location
objects
that map to the given line number.
This method is equivalent to
locationsOfLine(vm.getDefaultStratum(), null,
lineNumber)
-
see locationsOfLine(java.lang.String, java.lang.String, int)
for more information.
lineNumber | the line number |
---|
Location
objects that map to
the given line.AbsentInformationException |
---|
Returns a List containing all Location
objects
that map to the given line number.
For arrays (ArrayType
) and primitive classes, the
returned list is always empty.
For interfaces (InterfaceType
), the returned list
will be non-empty only if the interface has executable code
in its class initialization at the specified line number.
An empty list will be returned if there is no executable
code at the specified line number.
Returned list is for the specified stratum
(see Location
for a description of strata).
stratumID | the stratum to use for comparing line number
and source name, or null to
use the defaultStratum() . |
---|---|
sourceName | the source name containing the line
number, or null to match
all source names |
lineNumber | the line number |
Location
objects that map
to the given line.AbsentInformationException |
---|
Returns the class major version number, as defined in the class file format
of the Java Virtual Machine Specification.
For arrays (ArrayType
) and primitive classes,
the returned major version number value is zero.
Not all target virtual machines support this operation.
Use canGetClassFileVersion()
to determine if the operation is supported.
Returns a list containing each Method
declared
directly in this type.
Inherited methods are not included. Constructors,
the initialization method if any, and any synthetic methods created
by the compiler are included in the list.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Method
objects; the list has length 0
if no methods exist.Returns a List containing each visible Method
that
has the given name and signature.
The signature string is the
JNI signature for the target method:
()V
([Ljava/lang/String;)V
(IIII)Z
At most one method in the list is a concrete method and a
component of ClassType
; any other methods in the list
are abstract. Use concreteMethodByName(String, String)
to
retrieve only the matching concrete method.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
name | the name of the method to find. |
---|---|
signature | the signature of the method to find |
Method
objects that match the given
name and signature; the list has length 0 if no matching methods
are found.Returns a List containing each visible Method
that
has the given name. This is most commonly used to
find overloaded methods.
Overridden and hidden methods are not included. See JLS (8.4.6) for details.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
name | the name of the method to find. |
---|
Method
objects that match the given
name; the list has length 0 if no matching methods are found.Returns the class minor version number, as defined in the class file format
of the Java Virtual Machine Specification.
For arrays (ArrayType
) and primitive classes,
the returned minor version number value is zero.
Not all target virtual machines support this operation.
Use canGetClassFileVersion()
to determine if the operation is supported.
Returns the JavaTM programming language modifiers, encoded in an integer.
The modifier encodings are defined in the
Java Virtual Machine
Specification, in the access_flag
tables for
classes,
fields, and
methods.
Returns a List containing ReferenceType
objects that are
declared within this type and are currently loaded into the Virtual
Machine. Both static nested types and non-static nested
types (that is, inner types) are included. Local inner types
(declared within a code block somewhere in this reference type) are
also included in the returned list.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
ReferenceType
objects; the list
has 0 length if there are no nested types.
Returns the JNI-style signature for this type.
For primitive classes
the returned signature is the signature of the corresponding primitive
type; for example, "I" is returned as the signature of the class
represented by TYPE
.
Get the source debug extension of this type.
Not all target virtual machines support this operation.
Use
canGetSourceDebugExtension()
to determine if the operation is supported.
AbsentInformationException |
---|
Gets an identifying name for the source corresponding to the declaration of this type. Interpretation of this string is the responsibility of the source repository mechanism.
The returned name is dependent on VM's default stratum
(getDefaultStratum()
).
In the reference implementation, when using the base stratum,
the returned string is the
unqualified name of the source file containing the declaration
of this type. In other strata the returned source name is
the first source name for that stratum. Since other languages
may have more than one source name for a reference type,
the use of sourceName()
or
sourceNames(String)
is preferred.
For arrays (ArrayType
) and primitive classes,
AbsentInformationException is always thrown.
AbsentInformationException |
---|
Gets the identifying names for all the source corresponding to the declaration of this type. Interpretation of these names is the responsibility of the source repository mechanism.
The returned names are for the specified stratum
(see Location
for a description of strata).
In the reference implementation, when using the Java
programming language stratum,
the returned List contains one element: a String which is the
unqualified name of the source file containing the declaration
of this type. In other strata the returned source names are
all the source names defined for that stratum.
stratumID | The stratum to retrieve information from
or null for the declaring type's
default stratum. |
---|
AbsentInformationException |
---|
Gets the paths to the source corresponding to the declaration of this type. Interpretation of these paths is the responsibility of the source repository mechanism.
The returned paths are for the specified stratum
(see Location
for a description of strata).
In the reference implementation, for strata which
do not explicitly specify source path (the Java
programming language stratum never does), the returned
strings are the sourceNames(String)
prefixed by
the package name of this ReferenceType
converted to a platform dependent path.
For example, on a Windows platform,
java.lang.Thread
would return a List containing one element:
"java\lang\Thread.java"
.
stratumID | The stratum to retrieve information from
or null for the declaring type's
default stratum. |
---|
AbsentInformationException |
---|
Returns a list containing each unhidden and unambiguous Field
in this type.
Each field that can be accessed from the class
or its instances with its simple name is included. Fields that
are ambiguously multiply inherited or fields that are hidden by
fields with the same name in a more recently inherited class
cannot be accessed
by their simple names and are not included in the returned
list. All other inherited fields are included.
See JLS section 8.3 for details.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Field
objects; the list has length
0 if no visible fields exist.Returns a list containing each Method
declared or inherited by this type. Methods from superclasses
or superinterfaces that that have been hidden or overridden
are not included.
Note that despite this exclusion, multiple inherited methods
with the same signature can be present in the returned list, but
at most one can be a member of a ClassType
.
See JLS section 8.4.6 for details.
For arrays (ArrayType
) and primitive classes, the returned
list is always empty.
Method
objects; the list has length
0 if no visible methods exist.