Examples of JavaComment


Examples of net.percederberg.grammatica.code.java.JavaComment

        file.addClass(cls);
        str = TYPE_COMMENT;
        if (gen.getClassComment() != null) {
            str += "\n\n" + gen.getClassComment();
        }
        cls.addComment(new JavaComment(str));

        // Add file comment
        str = file.toString() + "\n\n" + gen.getFileComment();
        file.addComment(new JavaComment(JavaComment.BLOCK, str));

        // 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() +
                                     " 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,
                                "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
        cls.addMethod(initMethod);
        initMethod.addComment(new JavaComment(INIT_METHOD_COMMENT));
        initMethod.addThrows("ParserCreationException");
        initMethod.addCode("ProductionPattern             pattern;");
        initMethod.addCode("ProductionPatternAlternative  alt;");
    }
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaComment

                        JavaVariable.FINAL;
            var = new JavaVariable(modifiers,
                                   "int",
                                   constant,
                                   String.valueOf(constantId + 3000));
            var.addComment(new JavaComment(PRODUCTION_COMMENT));
            cls.addVariable(var);
            constantNames.put(new Integer(pattern.getId()), constant);
            constantId++;
        }
    }
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaComment

        // Add interface
        file.addInterface(ifc);

        // Add file comment
        str = file.toString() + "\n\n" + gen.getFileComment();
        file.addComment(new JavaComment(JavaComment.BLOCK, str));

        // Add interface comment
        str = TYPE_COMMENT;
        if (gen.getClassComment() != null) {
            str += "\n\n" + gen.getClassComment();
        }
        ifc.addComment(new JavaComment(str));
    }
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaComment

                    JavaVariable.FINAL;
        var = new JavaVariable(modifiers,
                               "int",
                               constant,
                               "" + pattern.getId());
        var.addComment(new JavaComment(TOKEN_COMMENT));
        ifc.addVariable(var);
        constantNames.put(new Integer(pattern.getId()), constant);
    }
View Full Code Here

Examples of net.percederberg.grammatica.code.java.JavaComment

                        JavaVariable.FINAL;
            var = new JavaVariable(modifiers,
                                   "int",
                                   constant,
                                   "" + pattern.getId());
            var.addComment(new JavaComment(PRODUCTION_COMMENT));
            ifc.addVariable(var);
            constantNames.put(new Integer(pattern.getId()), constant);
        }
    }
View Full Code Here

Examples of org.ajax4jsf.builder.model.JavaComment

  protected JavaField getField(PropertyBean propertyBean, JSFGeneratorConfiguration configuration) {
    String name = propertyBean.getName();
    String defaultvalue = propertyBean.getDefaultvalue();
    Class<?> propertyClass = getType(propertyBean, configuration.getClassLoader());
    JavaField field = new JavaField(propertyClass, "_" + name, defaultvalue);
    field.getComments().add(new JavaComment(propertyBean.getXmlEncodedDescription()));
    field.getModifiers().add(JavaModifier.PRIVATE);
   
    if (propertyBean.isTransient()) {
        field.addModifier(JavaModifier.TRANSIENT);
    }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment

    /** Generates the abstract invoker class.
     */
    public JavaSource getInvokerClass(JavaSource pSource) {
        JavaInnerClass invoker = pSource.newJavaInnerClass("Invoker", JavaSource.PUBLIC);
        JavaComment comment = invoker.newComment();
        comment.addLine("The dispatcher is implemented with a {@link java.util.Map}.");
        comment.addLine("The map keys are the method names, the values");
        comment.addLine("are instances of <code>Invoker</code>.");
        invoker.setType(JavaSource.INTERFACE);
        JavaMethod jm = invoker.newJavaMethod("invoke", Object.class, JavaSource.PUBLIC);
        comment = jm.newComment();
        comment.addLine("This method creates a new instance of the class being");
        comment.addLine("called, converts the parameter objects (if required)");
        comment.addLine("and invokes the requested method. If required, the");
        comment.addLine("result is converted also and returned.");
        jm.addParam(Vector.class, "pParams");
        jm.addThrows(Throwable.class);
        return invoker;
    }
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment

          if (i > 0) {
            sb.append(", ");
            }
            sb.append(params[i].getType());
        }
        JavaComment comment = js.newComment();
        comment.addLine("Invoker for method " + pMethod.getName() + "(" + sb + ")");
        comment.addLine("in class " + pMethod.getJavaSource().getQName() + ".");
        js.setStatic(true);
        js.addImplements(pInvoker);
        JavaMethod jm = js.newJavaMethod("invoke", Object.class, JavaSource.PUBLIC);
        Parameter param = jm.addParam(Vector.class, "params");
        JavaQName[] classes = pMethod.getExceptions();
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment

     */
    public JavaConstructor getDispatcherConstructor(JavaSource pSource,
                                                    JavaField pMap,
                                                    JavaQName pInvoker) {
        JavaConstructor con = pSource.newJavaConstructor(JavaSource.PUBLIC);
        JavaComment comment = con.newComment();
        comment.addLine("Creates a new dispatcher.");
        int num = 0;
        for (Iterator iter = methods.entrySet().iterator();  iter.hasNext()) {
            Map.Entry entry = (Map.Entry) iter.next();
            String name = (String) entry.getKey();
            JavaMethod method = (JavaMethod) entry.getValue();
View Full Code Here

Examples of org.apache.ws.jaxme.js.JavaComment

    /** Creates the dispatchers <code>invoke</code> method.
     */
    protected JavaMethod getDispatcherInvokeMethod(JavaSource pSource, JavaQName pInvoker) {
        JavaMethod jm = pSource.newJavaMethod("execute", Object.class, JavaSource.PUBLIC);
        JavaComment comment = jm.newComment();
        comment.addLine("Called for invocation of method <code>pName</code> with");
        comment.addLine("the parameters given by <code>pParams</code>.");
        Parameter name = jm.addParam(String.class, "pName");
        Parameter args = jm.addParam(Vector.class, "pParams");
        jm.addThrows(Exception.class);
        LocalJavaField invoker = jm.newJavaField(pInvoker);
        invoker.addLine("getInvoker(", name, ")");
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.