|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbluej.extensions.BMethod
A wrapper for a method of a BlueJ class.
Allows an extension to invoke a method on an object that is on the BlueJ object bench.
When values representing types are returned, there are two cases:
In the case that the returned value is of primitive type (int etc.),
it is represented in the appropriate Java wrapper type (Integer etc.).
In the case that the returned value is an object type then an appropriate BObject will
be returned, allowing the returned object itself to be placed on the BlueJ object bench.
| Method Summary | |
int |
getModifiers()
Returns the modifiers for this method. |
java.lang.String |
getName()
Returns the name of this method. |
java.lang.Class[] |
getParameterTypes()
Returns the types of the parameters of this method. |
java.lang.Class |
getReturnType()
Returns the return type of this method Similar to Reflection API |
java.lang.Object |
invoke(BObject onThis,
java.lang.Object[] params)
Invoke this method on the given object. |
boolean |
matches(java.lang.String methodName,
java.lang.Class[] parameter)
Tests if this method matches against the given signature. |
java.lang.String |
toString()
Returns a string representing the return type, name and signature of this 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.String methodName,
java.lang.Class[] parameter)
public java.lang.Class[] getParameterTypes()
public java.lang.String getName()
public java.lang.Class getReturnType()
public int getModifiers()
java.lang.reflect.Modifier class can be used to decode the modifiers.
public java.lang.Object invoke(BObject onThis,
java.lang.Object[] params)
throws ProjectNotOpenException,
PackageNotFoundException,
InvocationArgumentException,
InvocationErrorException
onThis - The BObject to which the method call should be applied, null if a static method.params - an array containing the arguments, or null if there are none
ProjectNotOpenException - if the project to which this object belongs has been closed by the user.
PackageNotFoundException - if the package to which this object belongs has been deleted by the user.
InvocationArgumentException - if the params don't match the object's arguments.
Inv ocationErrorException - if an error occurs during the invocation.public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||