Package org.apache.ws.jaxme.js

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


    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();
    LocalJavaField rs = jm.newJavaField(ResultSet.class);
    rs.addLine(stmt, ".executeQuery();");
    jm.addTry();
View Full Code Here


    jm.addTry();
    jm.addLine(connection, " = getConnection();");
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
    jm.addTry();
    LocalJavaField rs = jm.newJavaField(ResultSet.class);
    rs.addLine(stmt, ".executeQuery();");
    jm.addTry();
    jm.addWhile(rs, ".next()");
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") create()");
View Full Code Here

    jm.addTry();
    LocalJavaField rs = jm.newJavaField(ResultSet.class);
    rs.addLine(stmt, ".executeQuery();");
    jm.addTry();
    jm.addWhile(rs, ".next()");
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") create()");
    getResultSet(jm, rs, elem, table.getColumns(), 0);
    jm.addLine(pObserver, ".notify(", elem, ");");
    jm.addEndWhile();
View Full Code Here

  public JavaMethod getXMLGetArrayMethod(PropertySG pController, JavaSource pSource) throws SAXException {
      JavaMethod jm = pSource.newJavaMethod(pController.getXMLGetMethodName() + "Array", WildcardAttribute[].class, JavaSource.PUBLIC);
      JavaComment jc = jm.newComment();
      jc.addLine("<p>Returns the array of 'anyAttributes'.</p>");
      LocalJavaField size = jm.newJavaField(int.class);
      size.addLine(pController.getXMLFieldName(), ".size()");
      LocalJavaField result = jm.newJavaField(jm.getType());
      result.addLine("new ", WildcardAttribute.class, "[", size, "]");
      DirectAccessible iter = jm.addForCollection(new Object[]{pController.getXMLFieldName(), ".entrySet()"});
      LocalJavaField entry = jm.newJavaField(Map.Entry.class);
View Full Code Here

      JavaMethod jm = pSource.newJavaMethod(pController.getXMLGetMethodName() + "Array", WildcardAttribute[].class, JavaSource.PUBLIC);
      JavaComment jc = jm.newComment();
      jc.addLine("<p>Returns the array of 'anyAttributes'.</p>");
      LocalJavaField size = jm.newJavaField(int.class);
      size.addLine(pController.getXMLFieldName(), ".size()");
      LocalJavaField result = jm.newJavaField(jm.getType());
      result.addLine("new ", WildcardAttribute.class, "[", size, "]");
      DirectAccessible iter = jm.addForCollection(new Object[]{pController.getXMLFieldName(), ".entrySet()"});
      LocalJavaField entry = jm.newJavaField(Map.Entry.class);
      entry.addLine("(", Map.Entry.class, ") ", iter, ".next()");
      if (!pSource.isInterface()) {
View Full Code Here

      LocalJavaField size = jm.newJavaField(int.class);
      size.addLine(pController.getXMLFieldName(), ".size()");
      LocalJavaField result = jm.newJavaField(jm.getType());
      result.addLine("new ", WildcardAttribute.class, "[", size, "]");
      DirectAccessible iter = jm.addForCollection(new Object[]{pController.getXMLFieldName(), ".entrySet()"});
      LocalJavaField entry = jm.newJavaField(Map.Entry.class);
      entry.addLine("(", Map.Entry.class, ") ", iter, ".next()");
      if (!pSource.isInterface()) {
        jm.addLine(result, "[--", size, "] = new ", WildcardAttribute.class, "((",
                   QName.class, ") ", entry, ".getKey(), (", String.class, ") ",
             entry, ".getValue());");
View Full Code Here

        jm = pSource.newJavaMethod("marshalChilds", JavaQNameImpl.VOID, JavaSource.PROTECTED);
        DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
        sgLet = new XMLSerializersMarshalChildsSGlet(pData);
        JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
        DirectAccessible pObject = jm.addParam(Object.class, "pObject");
        pElement = jm.newJavaField(elementInterface);
        pElement.addLine("(", elementInterface, ") ", pObject);
        jm.addThrows(SAXException.class);
      }

      if (!particle.isElement()) {
View Full Code Here

    jm.addSwitch("--", pLevelVar);
    jm.addCase("0");
    jm.addBreak();
    jm.addCase("1");
    JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField element = jm.newJavaField(elementInterface);
    element.addLine("(", elementInterface, ") getResult()");
    jm.addSwitch(pStateVar);
    for (int i = 0;  i < myParticles.length;  i++) {
      ParticleSG child = myParticles[i];
      // TODO: process group case properly.
View Full Code Here

    Parameter pElement = jm.addParam(Element.class, "pElement");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

    String q = table.getSchema().getSQLFactory().newSQLGenerator().getQuery(table.getInsertStatement());
    LocalJavaField query = jm.newJavaField(String.class);
    query.setFinal(true);
    query.addLine(JavaSource.getQuoted(q));

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
View Full Code Here

    LocalJavaField query = jm.newJavaField(String.class);
    query.setFinal(true);
    query.addLine(JavaSource.getQuoted(q));

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") ", pElement);

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    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.