(BSHBlock body, CallStack callstack, Interpreter interpreter, String defaultPackage)
| 181 | |
| 182 | |
| 183 | static DelayedEvalBshMethod[] getDeclaredMethods(BSHBlock body, CallStack callstack, Interpreter interpreter, String defaultPackage) throws EvalError { |
| 184 | List<DelayedEvalBshMethod> methods = new ArrayList<DelayedEvalBshMethod>(); |
| 185 | for (int child = 0; child < body.jjtGetNumChildren(); child++) { |
| 186 | SimpleNode node = (SimpleNode) body.jjtGetChild(child); |
| 187 | if (node instanceof BSHMethodDeclaration) { |
| 188 | BSHMethodDeclaration md = (BSHMethodDeclaration) node; |
| 189 | md.insureNodesParsed(); |
| 190 | Modifiers modifiers = md.modifiers; |
| 191 | String name = md.name; |
| 192 | String returnType = md.getReturnTypeDescriptor(callstack, interpreter, defaultPackage); |
| 193 | BSHReturnType returnTypeNode = md.getReturnTypeNode(); |
| 194 | BSHFormalParameters paramTypesNode = md.paramsNode; |
| 195 | String[] paramTypes = paramTypesNode.getTypeDescriptors(callstack, interpreter, defaultPackage); |
| 196 | |
| 197 | DelayedEvalBshMethod bm = new DelayedEvalBshMethod(name, returnType, returnTypeNode, md.paramsNode.getParamNames(), paramTypes, paramTypesNode, md.blockNode, null/*declaringNameSpace*/, modifiers, callstack, interpreter); |
| 198 | |
| 199 | methods.add(bm); |
| 200 | } |
| 201 | } |
| 202 | return methods.toArray(new DelayedEvalBshMethod[methods.size()]); |
| 203 | } |
| 204 | |
| 205 | |
| 206 | /** |
no test coverage detected