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

public final Class ClassTypeImpl

extends InvokableTypeImpl
implements ClassType
Class Inheritance
All Implemented Interfaces
com.sun.jdi.ClassType, com.sun.jdi.ReferenceType, com.sun.jdi.Accessible, java.lang.Comparable, com.sun.jdi.Type, com.sun.jdi.Mirror
Imports
java.util.ArrayList, .List, com.sun.jdi.ClassNotLoadedException, .ClassType, .Field, .IncompatibleThreadStateException, .InterfaceType, .InvalidTypeException, .InvocationException, .Method, .ObjectReference, .ReferenceType, .ThreadReference, .Value, .VirtualMachine

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean
private List<InterfaceType>
private ClassType

Constructor Summary

AccessConstructor and Description
protected
ClassTypeImpl(VirtualMachine aVm, long aRef)

Method Summary

Modifier and TypeMethod and Description
public List<InterfaceType>
allInterfaces()

Implements com.sun.jdi.ClassType.allInterfaces.

Gets the interfaces directly and indirectly implemented by this class.

pack-priv boolean
canInvoke(Method method)

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.canInvoke.

Checks the provided method whether it can be invoked

public Method
concreteMethodByName(String name, String signature)

Implements com.sun.jdi.ClassType.concreteMethodByName.

Returns a single non-abstract Method visible from this class that has the given name and signature.

pack-priv CommandSender
getInvokeMethodSender(ThreadReferenceImpl thread, MethodImpl method, ValueImpl[] args, int options)

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.getInvokeMethodSender.

A subclass will provide specific CommandSender

public List<InterfaceType>
interfaces()

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.interfaces.

Implements com.sun.jdi.ClassType.interfaces.

Gets the interfaces directly implemented by this class.

public boolean
isEnum()

Implements com.sun.jdi.ClassType.isEnum.

Determine if this class was declared as an enum.

public ObjectReference
newInstance(ThreadReference threadIntf, Method methodIntf, List<? extends Value> origArguments, int options)

Implements com.sun.jdi.ClassType.newInstance.

Constructs a new instance of this type, using the given constructor Method in the target VM.

pack-priv PacketStream
sendNewInstanceCommand(final ThreadReferenceImpl thread, final MethodImpl method, final ValueImpl[] args, final int options)

public void
setValue(Field field, Value value)

Implements com.sun.jdi.ClassType.setValue.

Assigns a value to a static field.

public List<ClassType>
subclasses()

Implements com.sun.jdi.ClassType.subclasses.

Gets the currently loaded, direct subclasses of this class.

public ClassType
superclass()

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.superclass.

Implements com.sun.jdi.ClassType.superclass.

Gets the superclass of this class.

public String
toString()

Overrides java.lang.Object.toString.

Implements com.sun.jdi.Mirror.toString.

Returns a String describing this mirror

pack-priv void
pack-priv InvokableTypeImpl.InvocationResult
waitForReply(PacketStream stream)

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.waitForReply.

Waits for the reply to the last sent command

Inherited from com.sun.tools.jdi.InvokableTypeImpl:
addInterfacesaddVisibleMethodsallMethodsgetAllInterfacesinheritedTypesinvokeMethodisAssignableTo

Field Detail

cachedSuperclassback to summary
private boolean cachedSuperclass
interfacesback to summary
private List<InterfaceType> interfaces
superclassback to summary
private ClassType superclass

Constructor Detail

ClassTypeImplback to summary
protected ClassTypeImpl(VirtualMachine aVm, long aRef)

Method Detail

allInterfacesback to summary
public List<InterfaceType> allInterfaces()

Implements com.sun.jdi.ClassType.allInterfaces.

Doc from com.sun.jdi.ClassType.allInterfaces.

Gets the interfaces directly and indirectly implemented by this class. Interfaces returned by ClassType#interfaces are returned as well all superinterfaces.

Annotations
@Override
canInvokeback to summary
pack-priv boolean canInvoke(Method method)

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.canInvoke.

Doc from com.sun.tools.jdi.InvokableTypeImpl.canInvoke.

Checks the provided method whether it can be invoked

Annotations
@Override
concreteMethodByNameback to summary
public Method concreteMethodByName(String name, String signature)

Implements com.sun.jdi.ClassType.concreteMethodByName.

Doc from com.sun.jdi.ClassType.concreteMethodByName.

Returns a single non-abstract Method visible from this class that has the given name and signature. See ReferenceType#methodsByName(java.lang.String, java.lang.String) for information on signature format.

The returned method (if non-null) is a component of ClassType.

getInvokeMethodSenderback to summary
pack-priv CommandSender getInvokeMethodSender(ThreadReferenceImpl thread, MethodImpl method, ValueImpl[] args, int options)

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.getInvokeMethodSender.

Doc from com.sun.tools.jdi.InvokableTypeImpl.getInvokeMethodSender.

A subclass will provide specific CommandSender

Annotations
@Override
interfacesback to summary
public List<InterfaceType> interfaces()

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.interfaces.

Implements com.sun.jdi.ClassType.interfaces.

Doc from com.sun.jdi.ClassType.interfaces.

Gets the interfaces directly implemented by this class. Only the interfaces that are declared with the "implements" keyword in this class are included.

Annotations
@Override
isEnumback to summary
public boolean isEnum()

Implements com.sun.jdi.ClassType.isEnum.

Doc from com.sun.jdi.ClassType.isEnum.

Determine if this class was declared as an enum.

newInstanceback to summary
public ObjectReference newInstance(ThreadReference threadIntf, Method methodIntf, List<? extends Value> origArguments, int options) throws InvalidTypeException, ClassNotLoadedException, IncompatibleThreadStateException, InvocationException

Implements com.sun.jdi.ClassType.newInstance.

Doc from com.sun.jdi.ClassType.newInstance.

Constructs a new instance of this type, using the given constructor Method in the target VM. The specified constructor must be defined in this class.

Instance creation will occur in the specified thread. Instance creation can occur only if the specified thread has been suspended by an event which occurred in that thread. Instance creation is not supported when the target VM has been suspended through VirtualMachine#suspend or when the specified thread is suspended through ThreadReference#suspend.

The specified constructor is invoked with the arguments in the specified argument list. The invocation is synchronous; this method does not return until the constructor returns in the target VM. If the invoked method throws an exception, this method will throw an InvocationException which contains a mirror to the exception object thrown.

Object arguments must be assignment compatible with the argument type (This implies that the argument type must be loaded through the enclosing class' class loader). Primitive arguments must be either assignment compatible with the argument type or must be convertible to the argument type without loss of information. If the method being called accepts a variable number of arguments, then the last argument type is an array of some component type. The argument in the matching position can be omitted, or can be null, an array of the same component type, or an argument of the component type, followed by any number of other arguments of the same type. If the argument is omitted, then a 0 length array of the component type is passed. The component type can be a primitive type. Autoboxing is not supported. See section 5.2 of The Java Language Specification for more information on assignment compatibility.

By default, all threads in the target VM are resumed while the method is being invoked if they were previously suspended by an event or by VirtualMachine#suspend or ThreadReference#suspend. This is done to prevent the deadlocks that will occur if any of the threads own resources, such as monitors, that will be needed by the invoked method. It is possible that breakpoints or other events might occur during the invocation. Note, however, that this implicit resume acts exactly like ThreadReference#resume, so if the thread's suspend count is greater than 1, it will remain in a suspended state during the invocation. By default, when the invocation completes, all threads in the target VM are suspended, regardless their state before the invocation.

The resumption of other threads during the invocation can be prevented by specifying the INVOKE_SINGLE_THREADED bit flag in the options argument; however, there is no protection against or recovery from the deadlocks described above, so this option should be used with great caution. Only the specified thread will be resumed (as described for all threads above). Upon completion of a single threaded invoke, the invoking thread will be suspended once again. Note that any threads started during the single threaded invocation will not be suspended when the invocation completes.

If the target VM is disconnected during the invoke (for example, through VirtualMachine#dispose) the method invocation continues.

Exceptions
InvalidTypeException:
If the arguments do not meet this requirement -- Object arguments must be assignment compatible with the argument type. This implies that the argument type must be loaded through the enclosing class' class loader. Primitive arguments must be either assignment compatible with the argument type or must be convertible to the argument type without loss of information. See JLS section 5.2 for more information on assignment compatibility.
ClassNotLoadedException:
if any argument type has not yet been loaded through the appropriate class loader.
IncompatibleThreadStateException:
if the specified thread has not been suspended by an event.
InvocationException:
if the method invocation resulted in an exception in the target VM.
sendNewInstanceCommandback to summary
pack-priv PacketStream sendNewInstanceCommand(final ThreadReferenceImpl thread, final MethodImpl method, final ValueImpl[] args, final int options)
setValueback to summary
public void setValue(Field field, Value value) throws InvalidTypeException, ClassNotLoadedException

Implements com.sun.jdi.ClassType.setValue.

Doc from com.sun.jdi.ClassType.setValue.

Assigns a value to a static field. The Field must be valid for this ClassType; that is, it must be from the mirrored object's class or a superclass of that class. The field must not be final.

Object values must be assignment compatible with the field type (This implies that the field type must be loaded through the enclosing class' class loader). Primitive values must be either assignment compatible with the field type or must be convertible to the field type without loss of information. See JLS section 5.2 for more information on assignment compatibility.

Exceptions
InvalidTypeException:
if the value's type does not match the field's declared type.
ClassNotLoadedException:
if the field type has not yet been loaded through the appropriate class loader.
subclassesback to summary
public List<ClassType> subclasses()

Implements com.sun.jdi.ClassType.subclasses.

Doc from com.sun.jdi.ClassType.subclasses.

Gets the currently loaded, direct subclasses of this class. No ordering of this list is guaranteed.

superclassback to summary
public ClassType superclass()

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.superclass.

Implements com.sun.jdi.ClassType.superclass.

Doc from com.sun.jdi.ClassType.superclass.

Gets the superclass of this class.

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

validateConstructorInvocationback to summary
pack-priv void validateConstructorInvocation(Method method) throws InvalidTypeException, InvocationException
waitForReplyback to summary
pack-priv InvokableTypeImpl.InvocationResult waitForReply(PacketStream stream) throws JDWPException

Implements abstract com.sun.tools.jdi.InvokableTypeImpl.waitForReply.

Doc from com.sun.tools.jdi.InvokableTypeImpl.waitForReply.

Waits for the reply to the last sent command

Annotations
@Override
Exceptions
JDWPException:
when something goes wrong in JDWP
com.sun.tools.jdi back to summary

private Class ClassTypeImpl.IResult

extends Object
implements InvocationResult
Class Inheritance
All Implemented Interfaces
com.sun.tools.jdi.InvokableTypeImpl.InvocationResult

Field Summary

Modifier and TypeField and Description
private final JDWP.ClassType.InvokeMethod

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ObjectReferenceImpl
public ValueImpl
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

rsltback to summary
private final JDWP.ClassType.InvokeMethod rslt

Constructor Detail

IResultback to summary
public IResult(JDWP.ClassType.InvokeMethod rslt)

Method Detail

getExceptionback to summary
public ObjectReferenceImpl getException()

Implements com.sun.tools.jdi.InvokableTypeImpl.InvocationResult.getException.

Annotations
@Override
getResultback to summary
public ValueImpl getResult()

Implements com.sun.tools.jdi.InvokableTypeImpl.InvocationResult.getResult.

Annotations
@Override