Package com.sun.codemodel

Examples of com.sun.codemodel.JInvocation.invoke()


      }
    }

    // fallback.
    eval.add(getValueAccessor.invoke("get").arg(indexVariable).arg(out.getHolder()));
  }

  public static JInvocation write(MajorType type, JVar vector, HoldingContainer in, JExpression indexVariable, String setMethodName) {

    JInvocation setMethod = vector.invoke("getMutator").invoke(setMethodName).arg(indexVariable);
View Full Code Here


        setter.body().assign(JExpr._this().ref(fieldName), JExpr.ref(fieldName));
      }

      // append to the toString
      if (appendChain != null) { // a comma is needed
        appendChain = appendChain.invoke("append").arg("," + fieldName + "=");
      } else {
        appendChain = stringBuilderVar.invoke("append").arg(fieldName + "=");
      }

      // now add the field to the toString output
View Full Code Here

        appendChain = stringBuilderVar.invoke("append").arg(fieldName + "=");
      }

      // now add the field to the toString output
      JExpression expression = isArray ? arrays.staticInvoke("toString").arg(JExpr._this().ref(fieldName)) : JExpr._this().ref(fieldName);
      appendChain = appendChain.invoke("append").arg(expression);
    }

    if (appendChain != null) {
      appendChain = appendChain.invoke("append").arg("]");
    } else {
View Full Code Here

      JExpression expression = isArray ? arrays.staticInvoke("toString").arg(JExpr._this().ref(fieldName)) : JExpr._this().ref(fieldName);
      appendChain = appendChain.invoke("append").arg(expression);
    }

    if (appendChain != null) {
      appendChain = appendChain.invoke("append").arg("]");
    } else {
      appendChain = stringBuilderVar.invoke("append").arg("]");
    }

    toStringMethodBody.add(appendChain);
View Full Code Here

        .arg(fieldArr);

    JVar obj = b.decl( //
        objClass, //
        getNextVar("tmp"), //
        invoke.invoke(vectorAccess));

    b._if(obj.eq(JExpr._null()))._then()._throw(JExpr._new(t).arg(JExpr.lit(String.format("Failure while loading vector %s with id: %s.", vv.name(), fieldId.toString()))));
    //b.assign(vv, JExpr.cast(retClass, ((JExpression) JExpr.cast(wrapperClass, obj) ).invoke(vectorAccess)));
    b.assign(vv, JExpr.cast(retClass, obj ));
    vvDeclaration.put(setup, vv);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.