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
ObjectReferenceto access values or invoke, as applicable.
Method SummaryModifier and TypeMethodDescriptionReturns the type in which this component was declared.Gets the generic signature for this TypeComponent if there is one.
isFinal()Determines if this TypeComponent is final.
isStatic()Determines if this TypeComponent is static.
booleanDetermines if this TypeComponent is synthetic.
name()Gets the name of this type component.Gets the type signature for this type component.
Methods declared in interface com.sun.jdi.Accessible
isPackagePrivate, isPrivate, isProtected, isPublic, modifiers
nameString name()Gets the name of this type component.
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>.
- a string containing the name.
signatureString signature()Gets the type signature for this type component. The signature is encoded type information as defined in the JNI documentation. It is a convenient, compact format for for manipulating type information internally, not necessarily for display to an end user. See
Method.returnTypeName()for ways to help get a more readable representation of the type.
- a string containing the signature
genericSignatureString genericSignature()Gets the generic signature for this TypeComponent if there is one. Generic signatures are described in the The Java Virtual Machine Specification.
- a string containing the generic signature, or
nullif there is no generic signature.
declaringTypeReferenceType declaringType()Returns the type in which this component was declared. The returned
ReferenceTypemirrors either a class or an interface in the target VM.
ReferenceTypefor the type that declared this type component.
isStaticboolean isStatic()Determines if this TypeComponent is static. Return value is undefined for constructors and static initializers.
trueif this type component was declared static; false otherwise.
isFinalboolean isFinal()Determines if this TypeComponent is final. Return value is undefined for constructors and static initializers.
trueif this type component was declared final; false otherwise.
isSyntheticboolean isSynthetic()Determines if this TypeComponent is synthetic. Synthetic members are generated by the compiler and are not present in the source code for the containing class.
Not all target VMs support this query. See
VirtualMachine.canGetSyntheticAttribute()to determine if the operation is supported.
trueif this type component is synthetic;
UnsupportedOperationException- if the target VM cannot provide information on synthetic attributes.