Example usage for weka.core AllJavadoc setUseStars

List of usage examples for weka.core AllJavadoc setUseStars

Introduction

In this page you can find the example usage for weka.core AllJavadoc setUseStars.

Prototype

@Override
public void setUseStars(boolean value) 

Source Link

Document

sets whether to prefix the Javadoc with "*"

Usage

From source file:mulan.core.MulanJavadoc.java

License:Open Source License

/**
 * Updates comments/*w w w .j av a2  s  . co m*/
 *
 * @param classname
 * @throws java.lang.Exception
 */
public static void updateJavadoc(String classname) throws Exception {

    AllJavadoc jdoc = new AllJavadoc();
    jdoc.setClassname(classname);
    jdoc.setDir(dir);
    jdoc.setUseStars(false);

    String result = "";

    try {
        result = jdoc.updateJavadoc();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    //System.out.println(result + "\n");

    File file;
    BufferedWriter writer;

    if (!result.isEmpty()) {
        file = new File(jdoc.getDir() + "/" + jdoc.getClassname().replaceAll("\\.", "/") + ".java");
        if (!file.exists()) {
            System.out.println("File '" + file.getAbsolutePath() + "' doesn't exist!");
            return;
        }

        writer = new BufferedWriter(new FileWriter(file));
        writer.write(result);
        writer.close();

        System.out.println(jdoc.getClassname() + "'s Javadoc successfully updated.");

        return;
    } else {
        System.out.println(jdoc.getClassname() + "'s Javadoc update failed. Skipping file..");
    }

}