APIdia Launch Partner
Top Description Methods
com.sun.jdi

public Interface TypeComponent

extends Mirror, Accessible
Known Direct Subinterfaces
com.sun.jdi.Field, com.sun.jdi.Method
Known Direct Implementers
com.sun.tools.jdi.TypeComponentImpl

An entity declared within a user defined type (class or interface). This interface is the root of the type component hierarchy which includes 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.
Authors
Robert Field, Gordon Hirsch, James McIlree
Since
1.3

Method Summary

Modifier and TypeMethod and Description
public ReferenceType

Returns:

a ReferenceType for the type that declared this type component.
declaringType
()

Returns the type in which this component was declared.

public String

Returns:

a string containing the generic signature, or null if there is no generic signature.
genericSignature
()

Gets the generic signature for this TypeComponent if there is one.

public boolean

Returns:

true if this type component was declared final; false otherwise.
isFinal
()

Determines if this TypeComponent is final.

public boolean

Returns:

true if this type component was declared static; false otherwise.
isStatic
()

Determines if this TypeComponent is static.

public boolean

Returns:

true if this type component is synthetic; false otherwise.
isSynthetic
()

Determines if this TypeComponent is synthetic.

public String

Returns:

a string containing the name.
name
()

Gets the name of this type component.

public String

Returns:

a string containing the signature
signature
()

Gets the type signature for this type component.

Inherited from com.sun.jdi.Accessible:
isPackagePrivateisPrivateisProtectedisPublicmodifiers
Inherited from com.sun.jdi.Mirror:
toStringvirtualMachine

Method Detail

declaringTypeback to summary
public ReferenceType declaringType()

Returns the type in which this component was declared. The returned ReferenceType mirrors either a class or an interface in the target VM.

Returns:ReferenceType

a ReferenceType for the type that declared this type component.

genericSignatureback to summary
public String genericSignature()

Gets the generic signature for this TypeComponent if there is one. Generic signatures are described in the The Java Virtual Machine Specification.

Returns:String

a string containing the generic signature, or null if there is no generic signature.

Since
1.5
isFinalback to summary
public boolean isFinal()

Determines if this TypeComponent is final. Return value is undefined for constructors and static initializers.

Returns:boolean

true if this type component was declared final; false otherwise.

isStaticback to summary
public boolean isStatic()

Determines if this TypeComponent is static. Return value is undefined for constructors and static initializers.

Returns:boolean

true if this type component was declared static; false otherwise.

isSyntheticback to summary
public boolean 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.

Returns:boolean

true if this type component is synthetic; false otherwise.

Exceptions
UnsupportedOperationException:
if the target VM cannot provide information on synthetic attributes.
nameback to summary
public String 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>.

Returns:String

a string containing the name.

signatureback to summary
public String 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 Field#typeName and Method#returnTypeName for ways to help get a more readable representation of the type.

Returns:String

a string containing the signature