Java 8 - Custom JavaDoc check using Doclet

user7294900 :

I'm interested in validating JavaDoc, I found this answer of customizing checks:

import com.sun.javadoc.*;

public class CheckingDoclet extends Doclet {

The problem com.sun.javadoc was removed and will be replaced only in java 9 (which means using at least java 10)

The declarations in this package have been superseded by those in the package jdk.javadoc.doclet. For more information, see the Migration Guide in the documentation for that package.

Is there any replacement using Java 8?

EDIT

I need a new check for preventing description after block tag,

In checkstyle there's no such rule and need to create a new check

In PMD there's no such rule and probably need to create a new check

PowerStat :

I would suggest to use the JavaDoc checks of your ide (my is eclipse) - and also of CheckStyle and PMD.

For all three you should do your own configuration!

Within eclipse you can find the configuration for JavaDocs at Windows/Preferences/Java/Compiler/Javadoc

For the case that you have special requirements that can not be fulfilled by these tools - then forget about eclipse. Your only chance is to write your own extensions for CheckStyle or PMD. For example see Writing CheckStyle checks.

Btw. also it is not recommended to use java internal api's - see Stackoverflow About Java 8 Doclets. To my best knowledge these api's will vanish with Java 9/10/11+. So it's not recommended to use them.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Packaging custom javadoc doclet with maven

ClassNotFoundException with custom xml serializer for javadoc doclet

Trouble with generating custom javadoc; 'cannot find doclet'

Can I generate Javadoc comments with the help of a custom doclet?

Incomplete Javadoc in Java 8?

How to work around the stricter Java 8 Javadoc when using Maven

Fixing Javadoc Errors for Java 8

Check if element exists in array using Java 8

How to test Java 9+ doclet without mocking Doclet API?

Java 8 grouping using custom collector?

Java 8: How to use javadoc aggregate

Java - Convention for using javadoc along with a method annotation?

How to check values in collection for uniques by some criteria using Java 8

Sort and check if numbers are in consecutive order using Java8

Check if DateString is valid from List of formats using Java8

How to check the right order of a list using Java 8 Lambda Expressions?

Iterate over a list of lists and check for a condition using java 8

Converting list object into custom Map using Java 8 stream object

Getting a ClassCastException when using a custom Collector with java 8 streams

java 8 handling custom exception when using Collectors.toMap

How to perform multiple operations on same custom object using Java 8

Java8: Using an IntStream as a Supplier parameter for custom Collector

How to sort an object Array using a custom Comparator interface in Java 8?

How to find maximum form custom object of objects using java 8

Where can you download the source for the standard JavaDoc doclet for current releases (1.5 or 1.6)

What is the alternative of com.sun.tools.javadoc.Main.execute to run Doclet in jdk 11?

Maven is not working in Java 8 when Javadoc tags are incomplete

Maven is not working in Java 8 when Javadoc tags are incomplete

Java 8 javadoc doclint feature 'tag not allowed here'