Examples of addThrows()


Examples of net.percederberg.grammatica.code.java.JavaConstructor.addThrows()

        // Add constructor
        constr = new JavaConstructor("Reader input");
        cls.addConstructor(constr);
        constr.addComment(new JavaComment(CONSTRUCTOR_COMMENT));
        constr.addThrows("ParserCreationException");
        constr.addCode("super(input, " +
                       !gen.getGrammar().getCaseSensitive() +
                       ");");
        constr.addCode("createPatterns();");
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaConstructor.addThrows()

        // Add constructor
        constr = new JavaConstructor("Reader in");
        cls.addConstructor(constr);
        constr.addComment(new JavaComment(CONSTRUCTOR1_COMMENT));
        constr.addThrows("ParserCreationException");
        constr.addCode("super(in);");
        constr.addCode("createPatterns();");

        // Add constructor
        constr = new JavaConstructor("Reader in, " + analyzer.getClassName() +
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaConstructor.addThrows()

        // Add constructor
        constr = new JavaConstructor("Reader in, " + analyzer.getClassName() +
                                     " analyzer");
        cls.addConstructor(constr);
        constr.addComment(new JavaComment(CONSTRUCTOR2_COMMENT));
        constr.addThrows("ParserCreationException");
        constr.addCode("super(in, analyzer);");
        constr.addCode("createPatterns();");

        // Add tokenizer factory method
        method = new JavaMethod(JavaMethod.PROTECTED,
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaMethod.addThrows()

        m = new JavaMethod(JavaMethod.PROTECTED,
                           "enter" + name,
                           type + " node",
                           "void");
        m.addComment(new JavaComment(ENTER_COMMENT));
        m.addThrows("ParseException");
        cls.addMethod(m);
    }

    /**
     * Adds an exit node method to this file.
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaMethod.addThrows()

        m = new JavaMethod(JavaMethod.PROTECTED,
                           "exit" + name,
                           type + " node",
                           "Node");
        m.addComment(new JavaComment(EXIT_COMMENT));
        m.addThrows("ParseException");
        m.addCode("return node;");
        cls.addMethod(m);
    }

    /**
 
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaMethod.addThrows()

        m = new JavaMethod(JavaMethod.PROTECTED,
                           "child" + name,
                           "Production node, Node child",
                           "void");
        m.addComment(new JavaComment(CHILD_COMMENT));
        m.addThrows("ParseException");
        m.addCode("node.addChild(child);");
        cls.addMethod(m);
    }

    /**
 
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaMethod.addThrows()

        // Add tokenizer factory method
        method = new JavaMethod(JavaMethod.PROTECTED,
                                "newTokenizer",
                                "Reader in",
                                "Tokenizer");
        method.addThrows("ParserCreationException");
        method.addComment(new JavaComment(FACTORY_COMMENT));
        method.addCode("return new " + tokenizer.getClassName() + "(in);");
        cls.addMethod(method);

        // Add init method
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment.addThrows()

                                                       JavaSource.PUBLIC);
    getInstanceByName.setStatic(true);
   getInstanceByName.addParam(String.class, "pName");
   JavaComment jc = getInstanceByName.newComment();
   jc.addLine("Returns the item with the given name.</p>");
   jc.addThrows(IllegalArgumentException.class.getName() +
               " The name <code>pName</code> is invalid and no such item exists.");
   getInstanceByName.addLine(String.class, " s = pName.intern();");
   boolean first = true;
   for (int i = 0;  i < pItems.length;  i++) {
    Item item = pItems[i];
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment.addThrows()

                                       JavaSource.PUBLIC);
   getInstanceByValue.setStatic(true);
   getInstanceByValue.addParam(String.class, "pValue");
   jc = getInstanceByValue.newComment();
   jc.addLine("Returns the item with the given value.</p>");
   jc.addThrows(IllegalArgumentException.class.getName() +
            " The name <code>pValue</code> is invalid and no such item exists.");
   getInstanceByValue.addLine(String.class, " s = pValue.intern();");
   first = true;
   for (int i = 0;  i < pItems.length;  i++) {
    Item item = pItems[i];
View Full Code Here

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

    JavaSource js = pController.getJavaSourceFactory().newJavaSource(qName, "public");
    JavaField jf = js.newJavaField("jaxbContext", JAXBContextImpl.class, "private");
    JavaField properties = js.newJavaField("properties", Map.class, "private");

    JavaConstructor jcon = js.newJavaConstructor("public");
    jcon.addThrows(JAXBException.class);
    jcon.addLine(jf, " = (", JAXBContextImpl.class, ") ",
                 JAXBContext.class, ".newInstance(",
                 JavaSource.getQuoted(pPackageName), ");");

    JavaMethod newInstanceMethod = js.newJavaMethod("newInstance", Object.class, "public");
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.