Examples of addThrowNew()


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

        jm.addThrows(SAXException.class);
        jm.addTry();
        jm.addLine("return (", resultInterface, ") getData().getFactory().getElement(",
                   xmlElementInterface, ".class);");
        DirectAccessible e = jm.addCatch(JAXBException.class);
        jm.addThrowNew(SAXException.class, e);
        jm.addEndTry();
      } else {
        myTypeSG.getComplexTypeSG().generateXMLHandlerMethods(js);
      }
      return js;
View Full Code Here

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

    DirectAccessible i = fromValueMethod.addForArray(instances);
    fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
    fromValueMethod.addLine("return ", instances, "[", i, "];");
    fromValueMethod.addEndIf();
    fromValueMethod.addEndFor();
    fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),
                                " + ", pValue);

    JavaMethod fromNameMethod = js.newJavaMethod("fromName", qName, JavaSource.PUBLIC);
    pName = fromNameMethod.addParam(String.class, "pName");
    fromNameMethod.setStatic(true);
View Full Code Here

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

    i = fromNameMethod.addForArray(instances);
    fromNameMethod.addIf(instances, "[", i, "].name.equals(", pName, ")");
    fromNameMethod.addLine("return ", instances, "[", i, "];");
    fromNameMethod.addEndIf();
    fromNameMethod.addEndFor();
    fromNameMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid name: "),
                                " + ", pName);

    JavaMethod fromStringMethod = js.newJavaMethod("fromString", qName, JavaSource.PUBLIC);
    pValue = fromStringMethod.addParam(String.class, "pValue");
    fromStringMethod.setStatic(true);
View Full Code Here

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

      }
      lfj.setFinal(true);
      lfj.addLine(JavaSource.getQuoted("abc"));

      jcon.addLine(jf, " = 0;");
      jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("Not implemented"));
      return js;
   }

   public String getResult(JavaSource.Protection pProtection) {
      String p = (pProtection == null  ||  pProtection.equals(JavaSource.DEFAULT_PROTECTION)) ?
View Full Code Here

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

          jc.addLine("@throws IllegalArgumentException The namespace <code>pName.getNamespaceURI()</code> is invalid.");
      }
      Parameter pName = jm.addParam(QName.class, "pName");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
        jm.addLine("return (", String.class, ") ", pController.getXMLFieldName(), ".get(", pName, ");");
      }
      return jm;
View Full Code Here

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

      jc.addLine("@throws NullPointerException Either of the arguments <code>pName</code> or <code>pValue</code> is null.");
      Parameter pName = jm.addParam(QName.class, "pName");
      Parameter pValue = jm.addParam(String.class, "pValue");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        jm.addIf(pValue, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pValue argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
View Full Code Here

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

      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        jm.addIf(pValue, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pValue argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
        jm.addLine(pController.getXMLFieldName(), ".put(", pName, ", ", pValue, ");");
      }
      return jm;
View Full Code Here

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

      jc.addLine("@throws NullPointerException Either of the arguments <code>pName</code> or <code>pValue</code> is null.");
      jc.addLine("@return True, if the attribute was set, otherwise false.");
      Parameter pName = jm.addParam(QName.class, "pName");
      if (!pSource.isInterface()) {
        jm.addIf(pName, " == null");
        jm.addThrowNew(NullPointerException.class, JavaSource.getQuoted("The pName argument must not be null."));
        jm.addEndIf();
        getValidNamespaceCheck(pController, jm, pName);
        jm.addLine("return ", pController.getXMLFieldName(), ".remove(", pName, ") != null;");
      }
      return jm;
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
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.