Package org.apache.ws.jaxme.js

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


    for (Iterator iter = table.getColumns();  iter.hasNext()) {
      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();
View Full Code Here


    jm.addLine(query, " += ", JavaSource.getQuoted(" " + sb + " FROM " + table.getQName()), ";");
    jm.addIf(pQuery, " != null");
    jm.addLine(query, " += ", JavaSource.getQuoted(" WHERE "), " + ", pQuery, ";");
    jm.addEndIf();

    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, ")");
View Full Code Here

    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

      jm.addThrows(SAXException.class);
      jm.addSwitch("--", pLevelVar);
      jm.addCase("0");
      if (pController.hasSimpleContent()) {
          JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
          LocalJavaField element = jm.newJavaField(elementInterface);
          element.addLine("(", elementInterface, ") getResult()");

          SimpleContentSG simpleContent = pController.getSimpleContentSG();
          Object value = simpleContent.getContentTypeSG().getSimpleTypeSG().getCastFromString(jm, "__content.toString()", "getData()");
          simpleContent.getPropertySG().setValue(jm, element, value, null);
View Full Code Here

   
    JavaMethod jm = pSource.newJavaMethod("getAttributes", AttributesImpl.class, "protected");
    DirectAccessible pData = jm.addParam(JavaQNameImpl.getInstance(JMXmlSerializer.Data.class), "pData");
    DirectAccessible pElement = jm.addParam(Object.class, "pElement");
    jm.addThrows(SAXException.class);
    LocalJavaField result = jm.newJavaField(AttributesImpl.class);
    result.addLine("super.getAttributes(", pData, ", ", pElement, ")");
    JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField element = jm.newJavaField(elementInterface);
    element.addLine("(", elementInterface, ") ", pElement);
   
View Full Code Here

    DirectAccessible pElement = jm.addParam(Object.class, "pElement");
    jm.addThrows(SAXException.class);
    LocalJavaField result = jm.newJavaField(AttributesImpl.class);
    result.addLine("super.getAttributes(", pData, ", ", pElement, ")");
    JavaQName elementInterface = pController.getClassContext().getXMLInterfaceName();
    LocalJavaField element = jm.newJavaField(elementInterface);
    element.addLine("(", elementInterface, ") ", pElement);
   
    AttributeSG[] myAttributes = pController.getAttributes();
    XMLSerializerAttributeSGlet sgLet = new XMLSerializerAttributeSGlet(result, pData);
    for (int i = 0;  i < attributes.length;  i++) {
View Full Code Here

    AttributeSG[] myAttributes = pController.getAttributes();
    XMLSerializerAttributeSGlet sgLet = new XMLSerializerAttributeSGlet(result, pData);
    for (int i = 0;  i < attributes.length;  i++) {
      AttributeSG attribute = myAttributes[i];
      if (attribute.isWildcard()) {
          LocalJavaField anyAttributes = jm.newJavaField(WildcardAttribute[].class);
          anyAttributes.addLine(element, ".", attribute.getPropertySG().getXMLGetMethodName() + "Array", "()");
          DirectAccessible index = jm.addForArray(anyAttributes);
          LocalJavaField wildcardAttribute = jm.newJavaField(WildcardAttribute.class);
          wildcardAttribute.addLine(anyAttributes, "[", index, "]");
        LocalJavaField qName = jm.newJavaField(QName.class);
View Full Code Here

      AttributeSG attribute = myAttributes[i];
      if (attribute.isWildcard()) {
          LocalJavaField anyAttributes = jm.newJavaField(WildcardAttribute[].class);
          anyAttributes.addLine(element, ".", attribute.getPropertySG().getXMLGetMethodName() + "Array", "()");
          DirectAccessible index = jm.addForArray(anyAttributes);
          LocalJavaField wildcardAttribute = jm.newJavaField(WildcardAttribute.class);
          wildcardAttribute.addLine(anyAttributes, "[", index, "]");
        LocalJavaField qName = jm.newJavaField(QName.class);
        qName.addLine(wildcardAttribute, ".getName()");
        LocalJavaField uri = jm.newJavaField(String.class);
        uri.addLine(qName, ".getNamespaceURI()");
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.