Java Code Examples for com.sun.tools.doclint.DocLint#init()

The following examples show how to use com.sun.tools.doclint.DocLint#init() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 2
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 3
Source Project: jdk8u60   File: DocEnv.java    License: GNU General Public License v2.0 5 votes vote down vote up
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 4
Source Project: jdk8u60   File: RunTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 5
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 6
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 7
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 8
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 9
public void initDocLint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) {
    ArrayList<String> doclintOpts = new ArrayList<>();
    boolean msgOptionSeen = false;

    for (String opt : opts) {
        if (opt.startsWith(DocLint.XMSGS_OPTION)) {
            if (opt.equals(DocLint.XMSGS_CUSTOM_PREFIX + "none"))
                return;
            msgOptionSeen = true;
        }
        doclintOpts.add(opt);
    }

    if (!msgOptionSeen) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
    doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + htmlVersion);

    JavacTask t = BasicJavacTask.instance(toolEnv.context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 10
void initDoclint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) {
    ArrayList<String> doclintOpts = new ArrayList<>();
    boolean msgOptionSeen = false;

    for (String opt : opts) {
        if (opt.startsWith(DocLint.XMSGS_OPTION)) {
            if (opt.equals(DocLint.XMSGS_CUSTOM_PREFIX + "none"))
                return;
            msgOptionSeen = true;
        }
        doclintOpts.add(opt);
    }

    if (!msgOptionSeen) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
    doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + htmlVersion);

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 11
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 12
Source Project: hottub   File: DocEnv.java    License: GNU General Public License v2.0 5 votes vote down vote up
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 13
Source Project: hottub   File: RunTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 14
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 15
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}
 
Example 16
Source Project: openjdk-8   File: DocEnv.java    License: GNU General Public License v2.0 5 votes vote down vote up
void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
    ArrayList<String> doclintOpts = new ArrayList<String>();

    for (String opt: opts) {
        doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
    }

    if (doclintOpts.isEmpty()) {
        doclintOpts.add(DocLint.XMSGS_OPTION);
    } else if (doclintOpts.size() == 1
            && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
        return;
    }

    String sep = "";
    StringBuilder customTags = new StringBuilder();
    for (String customTag : customTagNames) {
        customTags.append(sep);
        customTags.append(customTag);
        sep = DocLint.TAGS_SEPARATOR;
    }
    doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());

    JavacTask t = BasicJavacTask.instance(context);
    doclint = new DocLint();
    // standard doclet normally generates H1, H2
    doclintOpts.add(DocLint.XIMPLICIT_HEADERS + "2");
    doclint.init(t, doclintOpts.toArray(new String[doclintOpts.size()]), false);
}
 
Example 17
Source Project: openjdk-8   File: RunTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
void testInit(boolean expectOK, String[] args, List<? extends JavaFileObject> files) {
    JavacTool javac = JavacTool.create();
    JavacTask task = javac.getTask(null, null, null, null, null, files);
    try {
        DocLint dl = new DocLint();
        dl.init(task, args, true);
        if (!expectOK)
            error("expected IllegalArgumentException not thrown");
        task.call();
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        if (expectOK)
            error("unexpected IllegalArgumentException caught");
    }
}