1 /* 2 JavadocStyle 3 scope = (default)private 4 excludeScope = (default)null 5 checkFirstSentence = (default)true 6 endOfSentenceFormat = ([.][ \t\n\r\f<])|([.]$) 7 checkEmptyJavadoc = (default)false 8 checkHtml = false 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 InputJavadocStyleFirstSentenceFormatOne 19 { 20 // This is OK. We don't flag missing javadoc. That's left for other checks. 21 private String first; 22 23 // violation below 'First sentence should end with a period.' 24 /** This Javadoc is missing an ending period */ 25 private String second; 26 27 /** 28 * We don't want {@link com.puppycrawl.tools.checkstyle.checks.JavadocStyleCheck} 29 * tags to stop the scan for the end of sentence. 30 * @see Something 31 */ 32 public InputJavadocStyleFirstSentenceFormatOne() {} 33 34 // violation below 'First sentence should end with a period.' 35 /** 36 * This is ok! 37 */ 38 private void method1() {} 39 40 // violation below 'First sentence should end with a period.' 41 /** 42 * This is ok? 43 */ 44 private void method2() {} 45 46 /** 47 * And This is ok.<br> 48 */ 49 private void method3() {} 50 51 // violation below 'First sentence should end with a period.' 52 /** 53 * This should fail even.though.there are embedded periods 54 */ 55 private void method4() {} 56 57 /** 58 * Test HTML in Javadoc comment 59 * <dl> 60 * <dt><b>This guy is missing end of bold tag 61 * <dd>The dt and dd don't require end tags. 62 * </dl> 63 * </td>Extra tag shouldn't be here 64 * <style>this tag isn't supported in Javadoc</style> 65 * @param arg1 <code>dummy. 66 */ 67 private void method5(int arg1) {} 68 69 // violation below 'First sentence should end with a period.' 70 /** 71 * Protected check <b>should fail 72 */ 73 protected void method6() {} 74 75 // violation below 'First sentence should end with a period.' 76 /** 77 * Package protected check <b>should fail 78 */ 79 void method7() {} 80 81 // violation below 'First sentence should end with a period.' 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 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 }