Interface TypeComponent
- All Superinterfaces:
-
Accessible
,Mirror
public interface TypeComponent extends Mirror, Accessible
Field
and Method
. Type components of the same name declared in different classes (including those related by inheritance) have different TypeComponent objects. TypeComponents can be used alone to retrieve static information about their declaration, or can be used in conjunction with a ReferenceType
or ObjectReference
to access values or invoke, as applicable.- Since:
- 1.3
Method Summary
Modifier and Type | Method | Description |
---|---|---|
ReferenceType |
declaringType() |
Returns the type in which this component was declared. |
String |
genericSignature() |
Gets the generic signature for this TypeComponent if there is one. |
boolean |
isFinal() |
Determines if this TypeComponent is final. |
boolean |
isStatic() |
Determines if this TypeComponent is static. |
boolean |
isSynthetic() |
Determines if this TypeComponent is synthetic. |
String |
name() |
Gets the name of this type component. |
String |
signature() |
Gets the type signature for this type component. |
Methods declared in interface com.sun.jdi.Accessible
isPackagePrivate, isPrivate, isProtected, isPublic, modifiers
Methods declared in interface com.sun.jdi.Mirror
toString, virtualMachine
Method Details
name
String name()
Note: for fields, this is the field name; for methods, this is the method name; for constructors, this is <init>; for static initializers, this is <clinit>.
- Returns:
- a string containing the name.
signature
String signature()
Field.typeName()
and Method.returnTypeName()
for ways to help get a more readable representation of the type.- Returns:
- a string containing the signature
genericSignature
String genericSignature()
- Returns:
- a string containing the generic signature, or
null
if there is no generic signature. - Since:
- 1.5
declaringType
ReferenceType declaringType()
ReferenceType
mirrors either a class or an interface in the target VM.- Returns:
- a
ReferenceType
for the type that declared this type component.
isStatic
boolean isStatic()
- Returns:
-
true
if this type component was declared static; false otherwise.
isFinal
boolean isFinal()
- Returns:
-
true
if this type component was declared final; false otherwise.
isSynthetic
boolean isSynthetic()
Not all target VMs support this query. See VirtualMachine.canGetSyntheticAttribute()
to determine if the operation is supported.
- Returns:
-
true
if this type component is synthetic;false
otherwise. - Throws:
-
UnsupportedOperationException
- if the target VM cannot provide information on synthetic attributes.
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/jdk.jdi/com/sun/jdi/TypeComponent.html