|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbsh.BshMethod
This represents an instance of a bsh method declaration in a particular namespace. This is a thin wrapper around the BSHMethodDeclaration with a pointer to the declaring namespace.
When a method is located in a subordinate namespace or invoked from an arbitrary namespace it must nontheless execute with its 'super' as the context in which it was declared.
| Field Summary | |
(package private) NameSpace |
declaringNameSpace
|
(package private) BSHBlock |
methodBody
|
(package private) Modifiers |
modifiers
|
| Constructor Summary | |
(package private) |
BshMethod(BSHMethodDeclaration method,
NameSpace declaringNameSpace,
Modifiers modifiers)
|
(package private) |
BshMethod(java.lang.reflect.Method method,
java.lang.Object object)
|
(package private) |
BshMethod(java.lang.String name,
java.lang.Class returnType,
java.lang.String[] paramNames,
java.lang.Class[] paramTypes,
BSHBlock methodBody,
NameSpace declaringNameSpace,
Modifiers modifiers)
|
| Method Summary | |
Modifiers |
getModifiers()
|
java.lang.String |
getName()
|
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. |
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,
SimpleNode callerInfo)
Invoke the declared method with the specified arguments, interpreter reference, and callstack. |
(package private) java.lang.Object |
invoke(java.lang.Object[] argValues,
Interpreter interpreter,
CallStack callstack,
SimpleNode callerInfo,
boolean overrideNameSpace)
Invoke the bsh method with the specified args, interpreter ref, and callstack. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
NameSpace declaringNameSpace
Modifiers modifiers
BSHBlock methodBody
| Constructor Detail |
BshMethod(BSHMethodDeclaration method,
NameSpace declaringNameSpace,
Modifiers modifiers)
BshMethod(java.lang.String name,
java.lang.Class returnType,
java.lang.String[] paramNames,
java.lang.Class[] paramTypes,
BSHBlock methodBody,
NameSpace declaringNameSpace,
Modifiers modifiers)
BshMethod(java.lang.reflect.Method method,
java.lang.Object object)
| Method Detail |
public java.lang.Class[] getParameterTypes()
public java.lang.String[] getParameterNames()
public java.lang.Class getReturnType()
public Modifiers getModifiers()
public java.lang.String getName()
public java.lang.Object invoke(java.lang.Object[] argValues,
Interpreter interpreter)
throws EvalError
EvalError
public java.lang.Object invoke(java.lang.Object[] argValues,
Interpreter interpreter,
CallStack callstack,
SimpleNode callerInfo)
throws EvalError
EvalError
java.lang.Object invoke(java.lang.Object[] argValues,
Interpreter interpreter,
CallStack callstack,
SimpleNode callerInfo,
boolean overrideNameSpace)
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).overrideNameSpace - When true the method is executed in the namespace on the top of the
stack instead of creating its own local namespace. This allows it
to be used in constructors.
EvalErrorpublic boolean hasModifier(java.lang.String name)
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||