public class BshMethod extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, BshClassManager.Listener
When a method is located in a subordinate namespace or invoked from an arbitrary namespace it must nonetheless execute with its 'super' as the context in which it was declared.
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isVarArgs |
protected bsh.BSHBlock |
methodBody |
| Modifier and Type | Method and Description |
|---|---|
void |
classLoaderChanged() |
BshMethod |
clone()
Cloneable clone method implementation, delegated to parent.
|
protected static boolean |
equal(java.lang.Object obj1,
java.lang.Object obj2) |
boolean |
equals(java.lang.Object o) |
Modifiers |
getModifiers() |
java.lang.String |
getName() |
int |
getParameterCount() |
Modifiers[] |
getParameterModifiers() |
java.lang.String[] |
getParameterNames() |
java.lang.Class<?>[] |
getParameterTypes()
Get the argument types of this method.
|
java.lang.Class<?> |
getReturnType()
Get the return type of the method.
|
int |
hashCode() |
boolean |
hasModifier(java.lang.String name) |
java.lang.Object |
invoke(java.lang.Object[] argValues,
Interpreter interpreter)
Invoke the declared method with the specified arguments and interpreter
reference.
|
java.lang.Object |
invoke(java.lang.Object[] argValues,
Interpreter interpreter,
CallStack callstack,
Node callerInfo)
Invoke the bsh method with the specified args, interpreter ref,
and callstack.
|
boolean |
isVarArgs() |
java.lang.String |
toString() |
public BshMethod clone()
clone in class java.lang.Objectpublic java.lang.Class<?>[] getParameterTypes()
public java.lang.String[] getParameterNames()
public Modifiers[] getParameterModifiers()
public int getParameterCount()
public java.lang.Class<?> getReturnType()
public Modifiers getModifiers()
public java.lang.String getName()
public boolean isVarArgs()
public java.lang.Object invoke(java.lang.Object[] argValues,
Interpreter interpreter)
throws EvalError
EvalErrorpublic java.lang.Object invoke(java.lang.Object[] argValues,
Interpreter interpreter,
CallStack callstack,
Node callerInfo)
throws EvalError
callerInfo - is the BeanShell AST node representing the method
invocation. It is used to print the line number and text of
errors in EvalError exceptions. If the node is null here error
messages may not be able to point to the precise location and text
of the error.callstack - is the callstack. If callstack is null a new one
will be created with the declaring namespace of the method on top
of the stack (i.e. it will look for purposes of the method
invocation like the method call occurred in the declaring
(enclosing) namespace in which the method is defined).EvalErrorpublic boolean hasModifier(java.lang.String name)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected static boolean equal(java.lang.Object obj1,
java.lang.Object obj2)
public int hashCode()
hashCode in class java.lang.Objectpublic void classLoaderChanged()
classLoaderChanged in interface BshClassManager.Listener