Examples of addThrowNew()


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

     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.addThrowNew()

     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.addThrowNew()

                                       InterfaceDescription[] pInterfaces)
            throws Exception{
    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()) {
                JavaSource js = pInterfaces[i].getJavaSource();
View Full Code Here

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

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

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

        }
        if (!exceptionList.isEmpty()) {
            for (int i = 0;  i < exceptionList.size();  i++) {
              JavaQName exClass = (JavaQName) exceptionList.get(i);
                DirectAccessible e = jm.addCatch(exClass);
                jm.addThrowNew(UndeclaredThrowableException.class, e);
            }
            jm.addEndTry();
        }
        return jm;
    }
View Full Code Here

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

        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();
        jm.addLine("return ", invoker, ".invoke(", args, ");");
View Full Code Here

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

        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;
    }

    /** Creates the dispatcher class. Make sure, that this method
View Full Code Here

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

          } else {
            jm2.addLine(jf, " = new ", handlerClassName, "();");
          }
          jm2.addLine(jf, ".init(getData());");
          DirectAccessible e = jm2.addCatch(JAXBException.class);
          jm2.addThrowNew(SAXException.class, e);
          jm2.addEndTry();
          jm2.addEndIf();
          jm2.addLine("return ", jf, ";");

          jm.addIf(jf, " != null");
View Full Code Here

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

      }
      child.getPropertySG().addValue(jm, element, v, type);
      jm.addBreak();
    }
    jm.addDefault();
    jm.addThrowNew(IllegalStateException.class, JavaSource.getQuoted("Illegal state: "), " + ",  pStateVar);
    jm.addEndSwitch();
    jm.addEndSwitch();

    return jm;
  }
View Full Code Here

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

    if (pController.getClassContext().isGlobal()) {
      jm.addTry();
      jm.addLine("return (", elementInterfaceClass, ") getData().getFactory().getElement(",
                 elementInterfaceClass, ".class);");
      DirectAccessible e = jm.addCatch(JAXBException.class);
      jm.addThrowNew(SAXException.class, e);
      jm.addEndTry();
    } else {
      JavaQName elementImplClass = pController.getClassContext().getXMLImplementationName();
      jm.addLine("return new ", elementImplClass, "();");
    }
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.