View Javadoc
1   ////////////////////////////////////////////////////////////////////////////////
2   // checkstyle: Checks Java source code for adherence to a set of rules.
3   // Copyright (C) 2001-2018 the original author or authors.
4   //
5   // This library is free software; you can redistribute it and/or
6   // modify it under the terms of the GNU Lesser General Public
7   // License as published by the Free Software Foundation; either
8   // version 2.1 of the License, or (at your option) any later version.
9   //
10  // This library is distributed in the hope that it will be useful,
11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  // Lesser General Public License for more details.
14  //
15  // You should have received a copy of the GNU Lesser General Public
16  // License along with this library; if not, write to the Free Software
17  // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  ////////////////////////////////////////////////////////////////////////////////
19  
20  package com.puppycrawl.tools.checkstyle.checks.javadoc.utils;
21  
22  import com.puppycrawl.tools.checkstyle.api.LineColumn;
23  
24  /**
25   * Value object for storing data about a parsed tag.
26   *
27   * @author Nathan Naze
28   */
29  public final class TagInfo {
30  
31      /**
32       * Name of the tag ("link", "see", etc).
33       */
34      private final String name;
35  
36      /**
37       * Value of the tag.
38       */
39      private final String value;
40  
41      /**
42       * Position of the tag in the given comment.
43       */
44      private final LineColumn position;
45  
46      /**
47       * Constructor.
48       *
49       * @param name The name of the tag.
50       * @param value The value of the tag.
51       * @param position The position of the tag in the comment.
52       */
53      public TagInfo(String name, String value, LineColumn position) {
54          this.name = name;
55          this.value = value;
56          this.position = position;
57      }
58  
59      /**
60       * Return name of tag.
61       * @return Name of the tag.
62       */
63      public String getName() {
64          return name;
65      }
66  
67      /**
68       * Return value of tag.
69       * @return Value of the tag.
70       */
71      public String getValue() {
72          return value;
73      }
74  
75      /**
76       * Return position of tag.
77       * @return Value of the tag.
78       */
79      public LineColumn getPosition() {
80          return position;
81      }
82  
83  }
84