View Javadoc

    1   /**
    2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
    3    */
    4   package net.sourceforge.pmd;
    5
    6   /**
    7    * A RuleViolation is created by a Rule when it identifies a violation of the
    8    * Rule constraints.
    9    *
    10   * @see Rule
    11   */
    12  public interface RuleViolation {
    13
    14      /**
    15       * Get the Rule which identified this violation.
    16       * @return The identifying Rule.
    17       */
    18      Rule getRule();
    19
    20      /**
    21       * Get the description of this violation.
    22       *
    23       * @return The description.
    24       */
    25      String getDescription();
    26
    27      /**
    28       * Indicates whether this violation has been suppressed.
    29       * @return <code>true</code> if this violation is suppressed, <code>false</code> otherwise.
    30       */
    31      boolean isSuppressed();
    32
    33      /**
    34       * Get the source file name in which this violation was identified.
    35       *
    36       * @return The source file name.
    37       */
    38      String getFilename();
    39
    40      /**
    41       * Get the begin line number in the source file in which this violation was
    42       * identified.
    43       *
    44       * @return Begin line number.
    45       */
    46      int getBeginLine();
    47
    48      /**
    49       * Get the column number of the begin line in the source file
    50       * in which this violation was identified.
    51       *
    52       * @return Begin column number.
    53       */
    54      int getBeginColumn();
    55
    56      /**
    57       * Get the end line number in the source file in which this violation was
    58       * identified.
    59       *
    60       * @return End line number.
    61       */
    62      int getEndLine();
    63
    64      /**
    65       * Get the column number of the end line in the source file
    66       * in which this violation was identified.
    67       *
    68       * @return End column number.
    69       */
    70      int getEndColumn();
    71
    72      /**
    73       * Get the package name of the Class in which this violation was identified.
    74       *
    75       * @return The package name.
    76       */
    77      // TODO Isn't this Java specific?
    78      String getPackageName();
    79
    80      /**
    81       * Get the name of the Class in which this violation was identified.
    82       *
    83       * @return The Class name.
    84       */
    85      // TODO Isn't this Java specific?
    86      String getClassName();
    87
    88      /**
    89       * Get the method name in which this violation was identified.
    90       *
    91       * @return The method name.
    92       */
    93      // TODO Isn't this Java specific?
    94      String getMethodName();
    95
    96      /**
    97       * Get the variable name on which this violation was identified.
    98       *
    99       * @return The variable name.
    100      */
    101     String getVariableName();
    102 }