コード例 #1
0
ファイル: MethodCall.java プロジェクト: bihai/net2java
 public String paramsAsJava() {
   String s = "";
   for (Iterator itr = this.parameters.iterator(); itr.hasNext(); ) {
     Object o = itr.next();
     if (o instanceof DNVariable) {
       DNVariable var = (DNVariable) o;
       s = s + var.getName();
     } else if (o instanceof Expression) {
       s = s + ((Expression) o).asJava();
     } else {
       throw new RuntimeException("Something funny in the params " + parameters);
     }
     if (itr.hasNext()) {
       s = s + ", ";
     }
   }
   return s;
 }
コード例 #2
0
ファイル: MethodCall.java プロジェクト: bihai/net2java
 private static List createVBArrayCreationDeclatationsAndSubstituteParams(
     List oldParameters, List newParameters, InterpretationContext context) {
   List arrayCreationDeclarations = new ArrayList();
   String s = ACE_VARIABLE_NAME;
   for (Iterator itr = oldParameters.iterator(); itr.hasNext(); ) {
     Object o = itr.next();
     if (o instanceof ArrayCreationExpression) {
       ArrayCreationExpression ace = (ArrayCreationExpression) o;
       LocalVariableDeclaration ds =
           LocalVariableDeclaration.createVBLocalVariableDeclaration(context, ace, s + aceCounter);
       arrayCreationDeclarations.add(ds);
       newParameters.add(DNVariable.createVBVariable(s + aceCounter, ace.getName() + "()"));
       aceCounter++;
     } else {
       newParameters.add(o);
     }
   }
   return arrayCreationDeclarations;
 }