本文整理匯總了Java中com.sun.javadoc.DocErrorReporter類的典型用法代碼示例。如果您正苦於以下問題:Java DocErrorReporter類的具體用法?Java DocErrorReporter怎麽用?Java DocErrorReporter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DocErrorReporter類屬於com.sun.javadoc包,在下文中一共展示了DocErrorReporter類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static boolean validOptions(String[][] options, DocErrorReporter reporter) {
boolean sawOutput = false;
for (int i = 0; i < options.length; i++) {
String[] option = options[i];
if (option[0].equals("-output")) {
File output = new File(option[1]);
if (output.exists() && output.isDirectory()) {
reporter.printError("Output file " + output + " is a directory");
return false;
} else {
sawOutput = true;
}
}
}
if (!sawOutput) {
reporter.printError("Missing -output");
return false;
}
return true;
}
示例2: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static boolean validOptions(String[][] options, DocErrorReporter reporter) {
for (int i = 0 ; i < options.length; i++) {
String opt = options[i][0].trim();
switch (opt) {
case "-genErrors":
genErrors = true;
genWarnings = false;
break;
case "-genWarnings":
genErrors = false;
genWarnings = true;
break;
}
}
return true;
}
示例3: checkOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
/**
* Checks that only valid options was specified.
* @param options all parsed options
* @param reporter the reporter to report errors.
* @return true if only valid options was specified
*/
public static boolean checkOptions(String[][] options, DocErrorReporter reporter) {
boolean foundDestFileOption = false;
boolean onlyOneDestFileOption = true;
for (final String[] opt : options) {
if (DEST_FILE_OPT.equals(opt[0])) {
if (foundDestFileOption) {
reporter.printError("Only one -destfile option allowed.");
onlyOneDestFileOption = false;
break;
}
foundDestFileOption = true;
}
}
if (!foundDestFileOption) {
reporter.printError("Usage: javadoc -destfile file -doclet TokenTypesDoclet ...");
}
return onlyOneDestFileOption && foundDestFileOption;
}
示例4: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
/** Specified for the Doclet API */
public static boolean validOptions(
String[][] options,
DocErrorReporter reporter) {
ImmutableList.Builder<String[]> optionsForStandardDoclet
= ImmutableList.builder();
boolean ok = true;
for (String[] optionArr : options) {
OptionName on = OPTION_NAMES.get(optionArr[0]);
if (on == null) {
optionsForStandardDoclet.add(optionArr);
} else {
ok &= on.isValid(optionArr, reporter);
}
}
ok &= Standard.validOptions(
optionsForStandardDoclet.build().toArray(new String[0][]), reporter);
return ok;
}
示例5: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static boolean validOptions(String options[][],
DocErrorReporter reporter) {
boolean foundOutput = false;
boolean foundTemplate = false;
for (int i = 0; i < options.length; i++) {
String[] opt = options[i];
if (opt[0].equals("-o")) {
foundOutput = true;
output = opt[1];
} else if (opt[0].equals("-ft")) {
foundTemplate = true;
template = new FileTemplateOption(opt[1]);
} else if (opt[0].equals("-ct")) {
foundTemplate = true;
template = new ClasspathTemplateOption(opt[1]);
}
}
if (!foundOutput || !foundTemplate) {
reporter.printError("Usage: javadoc -o OUTPUT_FILE -t TEMPLATE_FILE ...");
return false;
}
return true;
}
示例6: buildOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
private Options buildOptions(DocletOptions docletOptions, DocErrorReporter errorReporter) {
OptionsBuilder opts = defaultOptions();
if (docletOptions.baseDir().isPresent()) {
opts.baseDir(docletOptions.baseDir().get());
}
if (templates.isPresent()) {
opts.templateDir(templates.get().templateDir());
}
opts.attributes(buildAttributes(docletOptions, errorReporter));
if (docletOptions.requires().size() > 0) {
for (String require : docletOptions.requires()) {
asciidoctor.rubyExtensionRegistry().requireLibrary(require);
}
}
return opts.get();
}
示例7: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static void validOptions(String[][] options,
DocErrorReporter reporter) {
for (int i = 0; i < options.length; i++) {
String opt = options[i][0].toLowerCase(Locale.ENGLISH);
if (opt.equals(UNSTABLE_OPTION)) {
RootDocProcessor.stability = UNSTABLE_OPTION;
} else if (opt.equals(EVOLVING_OPTION)) {
RootDocProcessor.stability = EVOLVING_OPTION;
} else if (opt.equals(STABLE_OPTION)) {
RootDocProcessor.stability = STABLE_OPTION;
}
}
}
示例8: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static void validOptions(String[][] options, DocErrorReporter reporter) {
for (int i = 0; i < options.length; i++) {
String opt = options[i][0].toLowerCase();
if (opt.equals(UNSTABLE_OPTION)) {
RootDocProcessor.stability = UNSTABLE_OPTION;
} else if (opt.equals(EVOLVING_OPTION)) {
RootDocProcessor.stability = EVOLVING_OPTION;
} else if (opt.equals(STABLE_OPTION)) {
RootDocProcessor.stability = STABLE_OPTION;
}
}
}
示例9: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static void validOptions(String[][] options,
DocErrorReporter reporter) {
for (int i = 0; i < options.length; i++) {
String opt = options[i][0].toLowerCase(Locale.ENGLISH);
if (opt.equals(UNSTABLE_OPTION)) {
RootDocProcessor.stability = UNSTABLE_OPTION;
} else if (opt.equals(EVOLVING_OPTION)) {
RootDocProcessor.stability = EVOLVING_OPTION;
} else if (opt.equals(STABLE_OPTION)) {
RootDocProcessor.stability = STABLE_OPTION;
}
}
}
示例10: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
public static boolean validOptions(final String[][] options, final DocErrorReporter reporter) {
System.out.println("VALIDATING OPTIONS");
final Options opt = new Options(options);
if ((opt.factoryNames.size() == 0) || (opt.outputPath == null)) {
reporter.printError("Usage: -factory com.example.MyClass -destDir <outputFolder> [ -json ] [ -nohtml ]");
return false;
}
return true;
}
示例11: validOptions
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
/**
* Valid options boolean.
*
* @param options the options
* @param reporter the reporter
* @return the boolean
*/
public static boolean validOptions(final String[][] options, final DocErrorReporter reporter) {
try {
Options.validate(options);
} catch (IllegalStateException e) {
log.debug(e.getMessage(), e);
reporter.printError(e.getMessage());
return false;
}
return true;
}
示例12: setUp
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
@Before
public void setUp() {
mockReporter = Mockito.mock(DocErrorReporter.class);
UMLDocletConfig config = new UMLDocletConfig(new String[0][], mockReporter);
renderer = new YabadabadooRenderer(new DiagramRenderer(config));
}
示例13: testSplitDefaultValue
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
@Test
public void testSplitDefaultValue() {
UMLDocletConfig config = new UMLDocletConfig(new String[0][], mock(DocErrorReporter.class));
assertThat(config.excludedReferences(), is(equalTo((Collection<String>) asList(
Object.class.getName(), Enum.class.getName(), Annotation.class.getName()
))));
}
示例14: testSplitMultipleOccurrances
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
@Test
public void testSplitMultipleOccurrances() {
UMLDocletConfig config = new UMLDocletConfig(new String[][]{
{"-umlExcludedReferences", Object.class.getName()},
{"-umlExcludedReferences", Enum.class.getName()}
}, mock(DocErrorReporter.class));
assertThat(config.excludedReferences(), is(equalTo((Collection<String>) asList(
Object.class.getName(), Enum.class.getName()
))));
}
示例15: testIssue37_packagePrivateClassesDefaultValue
import com.sun.javadoc.DocErrorReporter; //導入依賴的package包/類
@Test
public void testIssue37_packagePrivateClassesDefaultValue() {
UMLDocletConfig config = new UMLDocletConfig(new String[0][], mock(DocErrorReporter.class));
ClassDoc packagePrivateClassDoc = mock(ClassDoc.class);
when(packagePrivateClassDoc.isPackagePrivate()).thenReturn(true);
when(packagePrivateClassDoc.tags(anyString())).thenReturn(new Tag[0]);
when(packagePrivateClassDoc.annotations()).thenReturn(new AnnotationDesc[0]);
assertThat(config.includeClass(packagePrivateClassDoc), is(false));
}