Class 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
    • 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.String getClassName()
      Returns the class name on which this invocation took place.
      InvocationFinishedEvent.EventType getEventType()
      Returns the termination type.
      java.lang.String getMethodName()
      Returns the method name being called.
      java.lang.String getObjectName()
      Returns the instance name of the invoked object on the object bench.
      BPackage getPackage()
      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.Object getResult()
      Returns the newly created object (if any).
      java.lang.Class<?>[] getSignature()
      Returns the signature of the invoked method or constructor.
      java.lang.String toString()
      Returns a meaningful description of this Event.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • InvocationFinishedEvent

        public InvocationFinishedEvent​(bluej.debugmgr.ExecutionEvent exevent)
        Parameters:
        exevent - an ExecutionEvent object associated with the invocation.
    • Method Detail

      • 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 BPackage object 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 with BPackage.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 with BPackage.getObject(String) using this name as a reference. For a static method invocation, this method will return null. 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. Returns null if 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 Class objects 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 String objects 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 of BObject.
        Returns:
        an Object object of various types, null if the result type is void.
      • toString

        public java.lang.String toString()
        Returns a meaningful description of this Event.
        Overrides:
        toString in class java.lang.Object