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