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

The following examples show how to use com.sun.tools.doclint.DocLint#isValidOption() . 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
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = StringUtils.toLowerCase(os[0]);
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 2
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = StringUtils.toLowerCase(os[0]);
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 3
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = StringUtils.toLowerCase(os[0]);
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 4
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = StringUtils.toLowerCase(os[0]);
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 5
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = StringUtils.toLowerCase(os[0]);
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 6
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = os[0].toLowerCase();
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}
 
Example 7
/**
 * {@inheritDoc}
 */
@Override
public boolean validOptions(String options[][],
        DocErrorReporter reporter) {
    boolean helpfile = false;
    boolean nohelp = false;
    boolean overview = false;
    boolean nooverview = false;
    boolean splitindex = false;
    boolean noindex = false;
    // check shared options
    if (!generalValidOptions(options, reporter)) {
        return false;
    }
    // otherwise look at our options
    for (int oi = 0; oi < options.length; ++oi) {
        String[] os = options[oi];
        String opt = os[0].toLowerCase();
        if (opt.equals("-helpfile")) {
            if (nohelp == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-helpfile", "-nohelp"));
                return false;
            }
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-helpfile"));
                return false;
            }
            DocFile help = DocFile.createFileForInput(this, os[1]);
            if (!help.exists()) {
                reporter.printError(getText("doclet.File_not_found", os[1]));
                return false;
            }
            helpfile = true;
        } else  if (opt.equals("-nohelp")) {
            if (helpfile == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nohelp", "-helpfile"));
                return false;
            }
            nohelp = true;
        } else if (opt.equals("-xdocrootparent")) {
            try {
                new URL(os[1]);
            } catch (MalformedURLException e) {
                reporter.printError(getText("doclet.MalformedURL", os[1]));
                return false;
            }
        } else if (opt.equals("-overview")) {
            if (nooverview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-overview", "-nooverview"));
                return false;
            }
            if (overview == true) {
                reporter.printError(getText("doclet.Option_reuse",
                    "-overview"));
                return false;
            }
            overview = true;
        } else  if (opt.equals("-nooverview")) {
            if (overview == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-nooverview", "-overview"));
                return false;
            }
            nooverview = true;
        } else if (opt.equals("-splitindex")) {
            if (noindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-splitindex", "-noindex"));
                return false;
            }
            splitindex = true;
        } else if (opt.equals("-noindex")) {
            if (splitindex == true) {
                reporter.printError(getText("doclet.Option_conflict",
                    "-noindex", "-splitindex"));
                return false;
            }
            noindex = true;
        } else if (opt.startsWith("-xdoclint:")) {
            if (opt.contains("/")) {
                reporter.printError(getText("doclet.Option_doclint_no_qualifiers"));
                return false;
            }
            if (!DocLint.isValidOption(
                    opt.replace("-xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX))) {
                reporter.printError(getText("doclet.Option_doclint_invalid_arg"));
                return false;
            }
        }
    }
    return true;
}