示例#1
0
 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
 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;
 }