Package bluej.extensions2.event
Class InvocationFinishedEvent
- java.lang.Object
-
- bluej.extensions2.event.InvocationFinishedEvent
-
- All Implemented Interfaces:
ExtensionEvent
public class InvocationFinishedEvent extends java.lang.Object implements ExtensionEvent
This class encapsulates events generated when the construction or invocation of a BlueJ object finishes. An invocation may finish in a normal way or it may be interrupted. From this event, an extension can extract the actual result of the invocation, and access the BlueJ classes and objects involved.- Author:
- Clive Miller, University of Kent at Canterbury, 2002, Damiano Bolla, University of Kent at Canterbury, 2003,2004
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInvocationFinishedEvent.EventTypeTypes of invocation finished events.
-
Constructor Summary
Constructors Constructor Description InvocationFinishedEvent(bluej.debugmgr.ExecutionEvent exevent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClassName()Returns the class name on which this invocation took place.InvocationFinishedEvent.EventTypegetEventType()Returns the termination type.java.lang.StringgetMethodName()Returns the method name being called.java.lang.StringgetObjectName()Returns the instance name of the invoked object on the object bench.BPackagegetPackage()Returns the package in which this invocation took place.java.lang.String[]getParameters()Returns the values of the parameters to the invocation as String objects.java.lang.ObjectgetResult()Returns the newly created object (if any).java.lang.Class<?>[]getSignature()Returns the signature of the invoked method or constructor.java.lang.StringtoString()Returns a meaningful description of this Event.
-
-
-
Method Detail
-
getEventType
public InvocationFinishedEvent.EventType getEventType()
Returns the termination type.- Returns:
- The
InvocationFinishedEvent.EventTypevalue associated with this InvocationFinishedEvent.
-
getPackage
public BPackage getPackage()
Returns the package in which this invocation took place. Further information about the context of the event can be retrieved via the package object.- Returns:
- The
BPackageobject wrapping the package in which this invocation took place.
-
getClassName
public java.lang.String getClassName()
Returns the class name on which this invocation took place. Further information about this class can be obtained withBPackage.getBClass(String name)using this name as a reference.
-
getObjectName
public java.lang.String getObjectName()
Returns the instance name of the invoked object on the object bench. Further information about this object can be obtained withBPackage.getObject(String)using this name as a reference. For a static method invocation, this method will returnnull. For a constructor call it will return the new instance name of the object on the object bench. For a method call it will return the name of the object on which the operation was invoked.
-
getMethodName
public java.lang.String getMethodName()
Returns the method name being called. Returnsnullif this is an invocation of a constructor.
-
getSignature
public java.lang.Class<?>[] getSignature()
Returns the signature of the invoked method or constructor. This is an array of Class objects representing the static types of the parameters to the method or constructor, in order. In the case of parameterised types, only the base type (e.g. List, not List<String>) is returned.- Returns:
- An array of
Classobjects corresponding to the static types of the method's parameters.
-
getParameters
public java.lang.String[] getParameters()
Returns the values of the parameters to the invocation as String objects. If a parameter really was a String, this will be returned either as the name of the string instance, or as a literal string enclosed in double quotes.- Returns:
- An array of
Stringobjects containing the values of the parameters.
-
getResult
public java.lang.Object getResult()
Returns the newly created object (if any). If the object is one that can be put on the object bench it will be an instance ofBObject.- Returns:
- an Object object of various types,
nullif the result type isvoid.
-
toString
public java.lang.String toString()
Returns a meaningful description of this Event.- Overrides:
toStringin classjava.lang.Object
-
-