Package org.apache.ws.jaxme.js

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


        Parameter name = jm.addParam(String.class, "pName");
        Parameter args = jm.addParam(Vector.class, "pParams");
        jm.addThrows(Exception.class);
        LocalJavaField invoker = jm.newJavaField(pInvoker);
        invoker.addLine("getInvoker(", name, ")");
        jm.addIf(invoker, " == null");
        jm.addThrowNew(IllegalStateException.class,
                       JavaSource.getQuoted("Unknown method name: "),
                       " + ", name);
        jm.addEndIf();
        jm.addTry();
View Full Code Here


      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

    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()), ";");
    jm.addIf(pQuery, " != null");
    jm.addLine(query, " += ", JavaSource.getQuoted(" WHERE "), " + ", pQuery, ";");
    jm.addEndIf();

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
View Full Code Here

          String handlerMethodName = getXMLHandlersMethodName(particle.getPropertySG());

          JavaField jf = pSource.newJavaField(handlerFieldName, JMHandler.class, JavaSource.PRIVATE);
          JavaMethod jm2 = pSource.newJavaMethod(handlerMethodName, JMHandler.class, "protected");
          jm2.addThrows(SAXException.class);
          jm2.addIf(handlerFieldName, " == null");
         
          ComplexTypeSG childSG = typeSG.getComplexTypeSG();
          JavaQName interfaceName = childSG.getClassContext().getXMLInterfaceName();
          JavaQName handlerClassName = childSG.getClassContext().getXMLHandlerName();
          jm2.addTry();
View Full Code Here

      if (namespaces.contains(uri)) {
        continue;
      }

      if ("".equals(uri)) {
        jm.addIf(namespaces.isEmpty(), pNamespaceURI, " == null  ||  ", pNamespaceURI, ".length() == 0");
      } else {
        jm.addIf(namespaces.isEmpty(), JavaSource.getQuoted(uri), ".equals(", pNamespaceURI, ")");
      }
      namespaces.add(uri);
View Full Code Here

      }

      if ("".equals(uri)) {
        jm.addIf(namespaces.isEmpty(), pNamespaceURI, " == null  ||  ", pNamespaceURI, ".length() == 0");
      } else {
        jm.addIf(namespaces.isEmpty(), JavaSource.getQuoted(uri), ".equals(", pNamespaceURI, ")");
      }
      namespaces.add(uri);

      // Now handle all elements with the namespace uri
      for (int j = i;  j < myParticles.length;  j++) {
View Full Code Here

        child = myParticles[j];
        XsQName name = child.getObjectSG().getName();
        if (!name.getNamespaceURI().equals(uri)) {
          continue;
        }
        jm.addIf(j == i, JavaSource.getQuoted(name.getLocalName()), ".equals(", pLocalName, ")");

        List validStates = new ArrayList();
        if (child.isMultiple()) {
          validStates.add(new Integer(j+3));
        }
View Full Code Here

    }
    jm.addEndIf();
    jm.addBreak();

    jm.addDefault();
    jm.addIf(pHandlerVar, " == null");
    jm.addLine("super.startElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ", ", pAttr, ");");
    jm.addElse();
    jm.addLine(pHandlerVar, ".startElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ", ", pAttr, ");");
    jm.addEndIf();
  }
View Full Code Here

    DirectAccessible pNamespaceURI = jm.addParam(String.class, "pNamespaceURI");
    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    jm.addThrows(SAXException.class);

    jm.addIf(pHandlerVar, " == null");
    jm.addIf(pLevelVar, " != 1");
    jm.addLine("super.endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
    jm.addElse();
    jm.addLine(pHandlerVar, ".endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
View Full Code Here

    DirectAccessible pLocalName = jm.addParam(String.class, "pLocalName");
    DirectAccessible pQName = jm.addParam(String.class, "pQName");
    jm.addThrows(SAXException.class);

    jm.addIf(pHandlerVar, " == null");
    jm.addIf(pLevelVar, " != 1");
    jm.addLine("super.endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
    jm.addElse();
    jm.addLine(pHandlerVar, ".endElement(", pNamespaceURI, ", ", pLocalName, ", ", pQName, ");");
    jm.addEndIf();
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.