diff --git a/src/xdocs/writingjavadocchecks.xml.vm b/src/xdocs/writingjavadocchecks.xml.vm index 425378fe0..b32e13098 100644 --- a/src/xdocs/writingjavadocchecks.xml.vm +++ b/src/xdocs/writingjavadocchecks.xml.vm @@ -22,9 +22,27 @@
+

+ To start implementing your own Check create new class and extend AbstractJavadocCheck. It has two abstract methods: +

+ +

+ Javadoc parser requires XHTML to be used in Javadoc comments, i.e. if there is some open tag(for example <div>) then there have to be its close tag </div>. + This means that if Javadoc comment has incorrect XHTML structure then Javadoc Parser will fail processing the comment, therefore, your new Check can't get its parse tree and process anything from this Javadoc comment. For more details and examples go to "HTML code in Javadoc comments" section. +

+

+ Java grammar parses java file due to language specifications. So, there are singleline comments and multiline/block comments in it. Java compiler doesn't know about Javadoc because it is just a multiline comment. + To parse multiline comment as a Javadoc comment, checkstyle has second grammar - Javadoc grammar. So, it's supposed to proccess block comments and parse them to Abstract Syntax Tree. + The problem is that Java grammar is old one and uses ANTLR v2, while Javadoc grammar uses ANTLR v4. Because of that, these two grammars and their trees are not compatible. + Java AST consists of DetailAST objects, while Javadoc AST consists of DetailNode objects. +

@@ -142,13 +160,14 @@ JAVADOC -> * My class.\r\n * @see AbstractClass [0:0] | `--CLASS -> AbstractClass [1:8] `--EOF -> [1:21] ]]> - -
+
+
+