Package org.apache.ws.jaxme.js

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


        Object result = new Object[]{pCaller, ".xmlRpcCall(",
                                 JavaSource.getQuoted(pName), ", ", v, ")"};
        if (JavaQNameImpl.VOID.equals(jm.getType())) {
            jm.addLine(result, ";");
        } else {
          jm.addLine("return ", getResultValue(jm, jm.getType(), result), ";");
        }
        if (!exceptionList.isEmpty()) {
            for (int i = 0;  i < exceptionList.size();  i++) {
              JavaQName exClass = (JavaQName) exceptionList.get(i);
                DirectAccessible e = jm.addCatch(exClass);
View Full Code Here


            args.add(getResultValue(jm, p.getType(), new Object[]{param, ".elementAt(" + i + ")"}));
        }
        Object o = new Object[]{"new ", pMethod.getJavaSource().getQName(), "().",
                            pMethod.getName(), "(", args, ")"};
        if (JavaQNameImpl.VOID.equals(pMethod.getType())) {
          jm.addLine(o, ";");
            jm.addLine("return null;");
        } else {
            jm.addLine("return ", getInputValue(jm, pMethod.getType(), o), ";");
        }
        return js;
View Full Code Here

        }
        Object o = new Object[]{"new ", pMethod.getJavaSource().getQName(), "().",
                            pMethod.getName(), "(", args, ")"};
        if (JavaQNameImpl.VOID.equals(pMethod.getType())) {
          jm.addLine(o, ";");
            jm.addLine("return null;");
        } else {
            jm.addLine("return ", getInputValue(jm, pMethod.getType(), o), ";");
        }
        return js;
    }
View Full Code Here

                            pMethod.getName(), "(", args, ")"};
        if (JavaQNameImpl.VOID.equals(pMethod.getType())) {
          jm.addLine(o, ";");
            jm.addLine("return null;");
        } else {
            jm.addLine("return ", getInputValue(jm, pMethod.getType(), o), ";");
        }
        return js;
    }

    /** Creates the dispatchers constructor.
View Full Code Here

    /** Creates the dispatchers <code>getInvoker</code> method.
     */
    protected JavaMethod getGetInvokerMethod(JavaSource pSource, JavaQName pInvoker, JavaField pMap) {
      JavaMethod jm = pSource.newJavaMethod("getInvoker", pInvoker, JavaSource.PROTECTED);
        Parameter param = jm.addParam(String.class, "pName");
        jm.addLine("return (", pInvoker, ") ", pMap, ".get(", param, ");");
        return jm;
    }

    /** Creates the dispatchers <code>invoke</code> method.
     */
 
View Full Code Here

        jm.addThrowNew(IllegalStateException.class,
                       JavaSource.getQuoted("Unknown method name: "),
                       " + ", name);
        jm.addEndIf();
        jm.addTry();
        jm.addLine("return ", invoker, ".invoke(", args, ");");
        DirectAccessible e = jm.addCatch(Exception.class);
        jm.addLine("throw ", e, ";");
        DirectAccessible t = jm.addCatch(Throwable.class);
        jm.addThrowNew(UndeclaredThrowableException.class, t);
        jm.addEndTry();
View Full Code Here

                       " + ", name);
        jm.addEndIf();
        jm.addTry();
        jm.addLine("return ", invoker, ".invoke(", args, ");");
        DirectAccessible e = jm.addCatch(Exception.class);
        jm.addLine("throw ", e, ";");
        DirectAccessible t = jm.addCatch(Throwable.class);
        jm.addThrowNew(UndeclaredThrowableException.class, t);
        jm.addEndTry();
        return jm;
    }
View Full Code Here

    elem.addLine("(", qName, ") ", pElement);

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    jm.addTry();
    jm.addLine(connection, " = getConnection();");
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
    jm.addTry();
    getPreparedStatementParameters(jm, stmt, elem, table.getColumns(), 0);
    jm.addLine(stmt, ".executeUpdate();");
View Full Code Here

    jm.addLine(connection, " = getConnection();");
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
    jm.addTry();
    getPreparedStatementParameters(jm, stmt, elem, table.getColumns(), 0);
    jm.addLine(stmt, ".executeUpdate();");
    getFinally(jm, stmt, null, null);
    getFinally(jm, connection, new Object[]{JavaSource.getQuoted("Failed to execute query "),
                                            " + ", query}, null);
    return jm;
  }
View Full Code Here

    elem.addLine("(", qName, ") ", pElement);

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    jm.addTry();
    jm.addLine(connection, " = getConnection();");

    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
    jm.addTry();
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.