Examples of addIf()


Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

   if (isAddingEquals()) {
     JavaMethod equals = pSource.newJavaMethod("equals", JavaQNameImpl.BOOLEAN,
                                               JavaSource.PUBLIC);
     equals.addParam(Object.class, "o");
     equals.addIf("o == null  ||  !(o instanceof ", pSource.getQName(), ")");
     equals.addLine("return false;");
     equals.addEndIf();
     equals.addLine("return name.equals(((", pSource.getQName(), ") o).name);");

      JavaMethod hashCode = pSource.newJavaMethod("hashCode", JavaQNameImpl.INT,
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

       LocalJavaField hashCodeResult = jm.newJavaField(int.class, "result");
       hashCodeResult.addLine(name, ".hashCode() + ", values, ".length;");
       DirectAccessible loopVar = jm.addForArray(values);
       LocalJavaField o = jm.newJavaField(Object.class, "o");
       o.addLine(values, "[", loopVar, "]");
       jm.addIf(o, " != null");
       jm.addLine(hashCodeResult, " += ", o, ".hashCode();");
       jm.addEndIf();
       jm.addEndFor();
       jm.addLine("return ", hashCodeResult, ";");
     }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

     }

     {
       JavaMethod jm = jic.newJavaMethod("equals", boolean.class, JavaSource.PUBLIC);
       DirectAccessible o = jm.addParam(Object.class, "o");
       jm.addIf(o, " == null  ||  !(", o, " instanceof ", jic.getQName(), ")");
       jm.addLine("return false;");
       jm.addEndIf();
       LocalJavaField other = jm.newJavaField(jic.getQName(), "other");
       other.addLine("(", jic.getQName(), ") ", o);
       jm.addIf("!", name, ".equals(", other, ".name)  ||  ", values, ".length != ",
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

       jm.addIf(o, " == null  ||  !(", o, " instanceof ", jic.getQName(), ")");
       jm.addLine("return false;");
       jm.addEndIf();
       LocalJavaField other = jm.newJavaField(jic.getQName(), "other");
       other.addLine("(", jic.getQName(), ") ", o);
       jm.addIf("!", name, ".equals(", other, ".name)  ||  ", values, ".length != ",
                other, ".values.length");
       jm.addLine("return false;");
       jm.addEndIf();
       DirectAccessible loopVar = jm.addForArray(values);
       LocalJavaField v = jm.newJavaField(Object.class, "v");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

       jm.addLine("return false;");
       jm.addEndIf();
       DirectAccessible loopVar = jm.addForArray(values);
       LocalJavaField v = jm.newJavaField(Object.class, "v");
       v.addLine(values, "[", loopVar, "]");
       jm.addIf(v, " == null");
       jm.addIf(other, ".values[", loopVar, "] != null");
       jm.addLine("return false;");
       jm.addEndIf();
       jm.addElse();
       jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

       jm.addEndIf();
       DirectAccessible loopVar = jm.addForArray(values);
       LocalJavaField v = jm.newJavaField(Object.class, "v");
       v.addLine(values, "[", loopVar, "]");
       jm.addIf(v, " == null");
       jm.addIf(other, ".values[", loopVar, "] != null");
       jm.addLine("return false;");
       jm.addEndIf();
       jm.addElse();
       jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
       jm.addLine("return false;");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

       jm.addIf(v, " == null");
       jm.addIf(other, ".values[", loopVar, "] != null");
       jm.addLine("return false;");
       jm.addEndIf();
       jm.addElse();
       jm.addIf("!", v, ".equals(", other, ".values[", loopVar, "])");
       jm.addLine("return false;");
       jm.addEndIf();
       jm.addEndIf();
       jm.addEndFor();
       jm.addLine("return true;");
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

    LocalJavaField baseKey = null;
    if (table.getPrimaryKey() != null) {
       baseKey = getCacheDataClassInstance(jm, pTableInfo,
                                                       table.getPrimaryKey(), values);
    jm.addIf(map, ".containsKey(", baseKey, ")");
    logFinestExiting(jm, JavaSource.getQuoted("null (Already cloned)"));
    jm.addLine("return null;");
    jm.addEndIf();
    }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

    jm.addLine(stmt, ".executeUpdate();");
    jm.addLine(isStmtClosed, " = true;");
    jm.addLine(stmt, ".close();");

    jm.addFinally();
    jm.addIf("!", isStmtClosed);
    jm.addTry();
    jm.addLine(stmt, ".close();");
    jm.addCatch(Throwable.class, "ignore");
    jm.addEndTry();
    jm.addEndIf();
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaMethod.addIf()

      Column col = (Column) iter.next();
      if (sb.length() > 0) sb.append(", ");
      sb.append(col.getName().getName());
    }
    LocalJavaField query = jm.newJavaField(String.class);
    jm.addIf(pParams, " != null  &&  pParams.isDistinct()");
    jm.addLine(query, " = ", JavaSource.getQuoted("SELECT DISTINCT"), ";");
    jm.addElse();
    jm.addLine(query, " = ", JavaSource.getQuoted("SELECT"), ";");
    jm.addEndIf();
    jm.addLine(query, " += ", JavaSource.getQuoted(" " + sb + " FROM " + table.getQName()), ";");
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.