bluej.extensions
Class BConstructor

java.lang.Object
  extended bybluej.extensions.BConstructor

public class BConstructor
extends java.lang.Object

A wrapper for a constructor of a BlueJ class. Behaviour is similar to reflection API.

Version:
$Id: BConstructor.java,v 1.23 2003/11/10 14:49:42 damiano Exp $

Method Summary
 java.lang.Class[] getParameterTypes()
          Returns the parameters of this constructor.
 boolean matches(java.lang.Class[] parameter)
          Tests if this constructor matches the given signature.
 BObject newInstance(java.lang.Object[] initargs)
          Creates a new instance of the object described by this constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

matches

public boolean matches(java.lang.Class[] parameter)
Tests if this constructor matches the given signature.

Returns:
true if it does, false otherwise.

getParameterTypes

public java.lang.Class[] getParameterTypes()
Returns the parameters of this constructor. Similar to reflection API.


newInstance

public BObject newInstance(java.lang.Object[] initargs)
                    throws ProjectNotOpenException,
                           PackageNotFoundException,
                           InvocationArgumentException,
                           InvocationErrorException
Creates a new instance of the object described by this constructor. Similar to reflection API.

Throws:
ProjectNotOpenException - if the project to which this constructor belongs has been closed by the user.
PackageNotFoundException - if the package to which this constructor belongs has been deleted by the user.
InvocationArgumentException - if the initargs don't match the constructor's arguments.
InvocationErrorException - if an error occurs during the invocation.


BlueJ homepage