Examples of addIf()


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

     }
     protected JavaConstructor getConstructor(JavaSource pJs,
                       InterfaceDescription[] pInterfaces) {
       JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PROTECTED);
       jcon.addParam(getChainInterface(), "o");
       jcon.addIf("o == null");
       jcon.addThrowNew(NullPointerException.class,
           JavaSource.getQuoted("The supplied object must not be null."));
       jcon.addEndIf();
       jcon.addLine("backingObject = o;");
       return jcon;
View Full Code Here

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

     }
     protected JavaConstructor getConstructor(JavaSource pJs,
                       InterfaceDescription[] pInterfaces) {
       JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PUBLIC);
       jcon.addParam(getChainInterface(), "o");
       jcon.addIf("o == null");
       jcon.addThrowNew(NullPointerException.class,
           JavaSource.getQuoted("The supplied object must not be null."));
       jcon.addEndIf();
       jcon.addLine("backingObject = o;");
       return jcon;
View Full Code Here

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

         }
         protected JavaConstructor getConstructor(JavaSource pJs,
                                                   InterfaceDescription[] pInterfaces) {
            JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PROTECTED);
            jcon.addParam(getChainInterface(), "o");
            jcon.addIf("o == null");
            jcon.addThrowNew(NullPointerException.class,
                             JavaSource.getQuoted("The supplied object must not be null."));
            jcon.addEndIf();
            jcon.addLine("backingObject = o;");
            return jcon;
View Full Code Here

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

         }
         protected JavaConstructor getConstructor(JavaSource pJs,
                                                   InterfaceDescription[] pInterfaces) {
            JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PUBLIC);
            jcon.addParam(getChainInterface(), "o");
            jcon.addIf("o == null");
            jcon.addThrowNew(NullPointerException.class,
                             JavaSource.getQuoted("The supplied object must not be null."));
            jcon.addEndIf();
            jcon.addLine("backingObject = o;");
            return jcon;
View Full Code Here

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

   * the backing object.</p>
   */
  protected JavaConstructor getConstructor(JavaSource pJs, InterfaceDescription[] pInterfaces) {
     JavaConstructor jcon = pJs.newJavaConstructor(JavaSource.PROTECTED);
    jcon.addParam(Object.class, "o");
    jcon.addIf("o == null");
    jcon.addThrowNew(NullPointerException.class,
                     JavaSource.getQuoted("The supplied object must not be null."));
    jcon.addEndIf();
    for (int i = 0;  i < pInterfaces.length;  i++) {
      if (pInterfaces[i].isMandatory) {
View Full Code Here

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

    jcon.addThrowNew(NullPointerException.class,
                     JavaSource.getQuoted("The supplied object must not be null."));
    jcon.addEndIf();
    for (int i = 0;  i < pInterfaces.length;  i++) {
      if (pInterfaces[i].isMandatory) {
        jcon.addIf("!(o instanceof ", pInterfaces[i].getInterface(), ")");
        jcon.addThrowNew(ClassCastException.class,
                      JavaSource.getQuoted("The supplied instance of "),
                      " + o.getClass().getName() + ",
                      JavaSource.getQuoted(" is not implementing "),
                      " + ", pInterfaces[i].getInterface(), ".class.getName()");
View Full Code Here

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

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

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

    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

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

          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
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.