|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bluej.extensions.BConstructor
public class BConstructor
A wrapper for a constructor of a BlueJ class. Behaviour is similar to reflection API.
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. |
java.lang.String |
toString()
Description of the Method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public boolean matches(java.lang.Class<?>[] parameter)
parameter
- Description of the Parameter
public java.lang.Class<?>[] getParameterTypes()
public BObject newInstance(java.lang.Object[] initargs) throws ProjectNotOpenException, PackageNotFoundException, InvocationArgumentException, InvocationErrorException
The arguments passed in the initargs array may have any type, but the type will determine exactly what is passed to the constructor:
An attempt is made to ensure that the argument types are suitable for the constructor. InvocationArgumentException will be thrown if the arguments are clearly unsuitable, however some cases will generate an InvocationErrorException instead. In such cases no expression arguments will be evaluated.
initargs
- Description of the Parameter
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.public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |