1 /* 2 JavadocStyle 3 scope = (default)private 4 excludeScope = (default)null 5 checkFirstSentence = false 6 endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$) 7 checkEmptyJavadoc = (default)false 8 checkHtml = (default)true 9 tokens = (default)ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, \ 10 ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, PACKAGE_DEF, \ 11 VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF 12 13 14 */ 15 16 package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocstyle; 17 18 public class InputJavadocStyleHtml1 { 19 // This is OK. We don't flag missing javadoc. That's left for other checks. 20 private String first; 21 22 /** This Javadoc is missing an ending period */ 23 private String second; 24 25 /** 26 * We don't want {@link com.puppycrawl.tools.checkstyle.checks.JavadocStyleCheck} 27 * tags to stop the scan for the end of sentence. 28 * @see Something 29 */ 30 public InputJavadocStyleHtml1() {} 31 32 /** 33 * This is ok! 34 */ 35 private void method1() {} 36 37 /** 38 * This is ok? 39 */ 40 private void method2() {} 41 42 /** 43 * And This is ok.<br> 44 */ 45 private void method3() {} 46 47 /** 48 * This should fail even.though.there are embedded periods 49 */ 50 private void method4() {} 51 52 // violation 7 lines below 'Unclosed HTML tag found: <b>' 53 // violation 9 lines below 'Extra HTML tag found: </td>' 54 // violation 9 lines below 'Extra HTML tag found: </style>' 55 // violation 9 lines below 'Unclosed HTML tag found: <code>dummy' 56 /** 57 * Test HTML in Javadoc comment 58 * <dl> 59 * <dt><b> 60 * <dd>The dt and dd don't require end tags. 61 * </dl> 62 * </td> 63 * <style>this tag isn't supported in Javadoc</style> 64 * @param arg1 <code>dummy 65 */ 66 private void method5(int arg1) {} 67 68 // violation 2 lines below 'Unclosed HTML tag found: <b>' 69 /** 70 * Protected check <b> 71 */ 72 protected void method6() {} 73 74 // violation 2 lines below 'Unclosed HTML tag found: <b>' 75 /** 76 * Package protected check <b> 77 */ 78 void method7() {} 79 80 // violation 3 lines below 'Extra HTML tag found: </code>' 81 // violation 3 lines below 'should fail <' 82 /** 83 * Public check should fail</code> 84 * should fail < 85 */ 86 public void method8() {} 87 88 /** {@inheritDoc} **/ 89 public void method9() {} 90 91 92 // Testcases to exercise the Tag parser (bug 843887) 93 // violation 6 lines below 'Extra HTML tag found: </img>' 94 /** 95 * Real men don't use XHTML. 96 * <br /> 97 * <hr/> 98 * < br/> 99 * <img src="schattenparker.jpg"/></img> 100 */ 101 private void method10() {} 102 103 /** 104 * Tag content can be really mean. 105 * <p> 106 * Sometimes a p tag is closed. 107 * </p> 108 * <p> 109 * Sometimes it's not. 110 * 111 * <span style="font-family:'Times New Roman',Times,serif;font-size:200%"> 112 * Attributes can contain spaces and nested quotes. 113 * </span> 114 * <img src="slashesCanOccurWithin/attributes.jpg"/> 115 * <img src="slashesCanOccurWithin/attributes.jpg"> 116 * <!-- comments <div> should not be checked. --> 117 */ 118 private void method11() {} 119 }