Package org.apache.ws.jaxme.js

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


        }
    }
    if (wildcard == null) {
        jm.addLine("super.addAttribute(", pURI, ", ", pLocalName, ", ", pValue, ");");
    } else {
        jm.addTry();
        jm.addLine(result, ".", wildcard.getPropertySG().getXMLSetMethodName(), "(new ",
                QName.class, "(", pURI, ", ", pLocalName, "), ", pValue, ");");
        jm.addCatch(IllegalArgumentException.class);
        jm.addLine("validationEvent(", ValidationEvent.class, ".ERROR, ",
                JavaSource.getQuoted("Invalid namespace for anyAttribute: '"),
View Full Code Here


  protected JavaMethod getXMLHandlersNewResultMethod(ComplexTypeSG pController, JavaSource pSource) {
    JavaQName elementInterfaceClass = pController.getClassContext().getXMLInterfaceName();
    JavaMethod jm = pSource.newJavaMethod("newResult", elementInterfaceClass, JavaSource.PROTECTED);
    jm.addThrows(SAXException.class);
    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();
View Full Code Here

        js.addExtends(typeContext.getXMLHandlerName());
        JavaQName xmlElementInterface = pController.getClassContext().getXMLInterfaceName();
        JavaQName resultInterface = typeContext.getXMLInterfaceName();
        JavaMethod jm = js.newJavaMethod("newResult", resultInterface, JavaSource.PROTECTED);
        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();
View Full Code Here

    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class, "stmt");
    stmt.setFinal(true);
    stmt.addLine(connection, ".prepareStatement(", query, ");");
    LocalJavaField isStmtClosed = jm.newJavaField(boolean.class, "isStmtClosed");
    isStmtClosed.addLine("false");
    jm.addTry();
   
    int paramNum = 0;
    for (Iterator iter = table.getColumns();  iter.hasNext()) {
      Column column = (Column) iter.next();
      Object v = new Object[]{ values, "[", Integer.toString(paramNum), "]" };
View Full Code Here

    jm.addLine(isStmtClosed, " = true;");
    jm.addLine(stmt, ".close();");
   
    jm.addFinally();
    jm.addIf("!", isStmtClosed);
    jm.addTry();
    jm.addLine(stmt, ".close();");
    jm.addCatch(Throwable.class, "ignore");
    jm.addEndTry();
    jm.addEndIf();
    jm.addEndTry();
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.