Examples of addCatch()


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

      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("getHandler().validationEvent(", ValidationEvent.class, ".ERROR, ",
          JavaSource.getQuoted("Invalid namespace for anyAttribute: '"),
          " + ", pURI, " + ", JavaSource.getQuoted("', attribute name is '"),
          " + ", pLocalName, " + ", JavaSource.getQuoted("'"),
          ", ", ValidationEvents.class, ".EVENT_UNKNOWN_ANY_ATTRIBUTE, null);");
View Full Code Here

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

   
    jm.addFinally();
    jm.addIf("!", isStmtClosed);
    jm.addTry();
    jm.addLine(stmt, ".close();");
    jm.addCatch(Throwable.class, "ignore");
    jm.addEndTry();
    jm.addEndIf();
    jm.addEndTry();
   
    logFinestExiting(jm, null);
View Full Code Here

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

      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("getHandler().validationEvent(", ValidationEvent.class, ".ERROR, ",
          JavaSource.getQuoted("Invalid namespace for anyAttribute: '"),
          " + ", pURI, " + ", JavaSource.getQuoted("', attribute name is '"),
          " + ", pLocalName, " + ", JavaSource.getQuoted("'"),
          ", ", ValidationEvents.class, ".EVENT_UNKNOWN_ANY_ATTRIBUTE, null);");
View Full Code Here

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

        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: '"),
                " + ", pURI, " + ", JavaSource.getQuoted("', attribute name is '"),
          " + ", pLocalName, " + ", JavaSource.getQuoted("'"),
          ", ", ValidationEvents.class, ".EVENT_UNKNOWN_ANY_ATTRIBUTE);");
View Full Code Here

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

    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();
    } else {
      JavaQName elementImplClass = pController.getClassContext().getXMLImplementationName();
      jm.addLine("return new ", elementImplClass, "();");
View Full Code Here

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

                        interfaceName, ".class);");
          } 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, ";");
View Full Code Here

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

        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();
      } else {
        myTypeSG.getComplexTypeSG().generateXMLHandlerMethods(js);
      }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.TryCatchStatement.addCatch()

        BlockStatement codeToHandleAllowedMethods = getCodeToHandleAllowedMethods(controllerClassNode, methodNode.getName());
        tryBlock.addStatement(codeToHandleAllowedMethods);
        tryBlock.addStatement(methodBody);

        final TryCatchStatement tryCatchStatement = new TryCatchStatement(tryBlock, new EmptyStatement());
        tryCatchStatement.addCatch(catchStatement);

        final ArgumentListExpression argumentListExpression = new ArgumentListExpression();
        argumentListExpression.addExpression(new ConstantExpression(ALLOWED_METHODS_HANDLED_ATTRIBUTE_NAME));
       
        final PropertyExpression requestPropertyExpression = new PropertyExpression(new VariableExpression("this"), "request");
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.TryCatchStatement.addCatch()

        final BlockStatement blockToRemoveAttribute = new BlockStatement();
        blockToRemoveAttribute.addStatement(new ExpressionStatement(initializeAttributeValue));
        blockToRemoveAttribute.addStatement(ifAttributeValueMatchesMethodName);
       
        final TryCatchStatement tryCatchToRemoveAttribute = new TryCatchStatement(blockToRemoveAttribute, new EmptyStatement());
        tryCatchToRemoveAttribute.addCatch(new CatchStatement(new Parameter(ClassHelper.make(Exception.class), "$exceptionRemovingAttribute"), new EmptyStatement()));

        tryCatchStatement.setFinallyStatement(tryCatchToRemoveAttribute);

        methodNode.setCode(tryCatchStatement);
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.TryCatchStatement.addCatch()

        BlockStatement catchBlock = new BlockStatement();
        ArgumentListExpression logArguments = new ArgumentListExpression();
        logArguments.addExpression(new BinaryExpression(new ConstantExpression("Error initializing class: "),Token.newSymbol(Types.PLUS, 0, 0),new VariableExpression("e")));
        logArguments.addExpression(new VariableExpression("e"));
        catchBlock.addStatement(new ExpressionStatement(new MethodCallExpression(new VariableExpression("log"), "error", logArguments)));
        tryCatchStatement.addCatch(new CatchStatement(new Parameter(new ClassNode(Throwable.class), "e"),catchBlock));
    }

    /**
     * Evaluates a constraints closure and returns metadata about the constraints configured in the closure.  The
     * Map returned has property names as keys and the value associated with each of those property names is
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.