KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > xpath > Attribute


1 ////////////////////////////////////////////////////////////////////////////////
2
// checkstyle: Checks Java source code for adherence to a set of rules.
3
// Copyright (C) 2001-2003 Oliver Burn
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
package com.puppycrawl.tools.checkstyle.checks.xpath;
20
21 import com.puppycrawl.tools.checkstyle.api.DetailAST;
22
23
24 /**
25  * Data holder for an XPath attribute of an element. The parent
26  * element of an Attribute is a DetailAST. The name and value
27  * of an Attribute are Strings.
28  * @author Rick Giles
29  */

30 public class Attribute
31 {
32     /** element owning this attribute */
33     private DetailAST mParent;
34
35     /** name */
36     private String JavaDoc mName;
37
38     /** value */
39     private String JavaDoc mValue;
40
41     /**
42      * Constructs an <code>Attribute</code>.
43      * @param aParent the parent element.
44      * @param aName the name.
45      * @param aValue the value.
46      */

47     public Attribute(DetailAST aParent, String JavaDoc aName, String JavaDoc aValue)
48     {
49         mParent = aParent;
50         mName = aName;
51         mValue = aValue;
52     }
53
54     /** Returns the name of the attribute.
55      * @return the name of the attribute.
56      */

57     public String JavaDoc getName()
58     {
59         return mName;
60     }
61
62     /**
63      * Returns the value of the attribute.
64      * @return the value of the attribute.
65      */

66     public String JavaDoc getValue()
67     {
68         return mValue;
69     }
70
71     /**
72      * Sets the name of the attribute.
73      * @param aName The name to set.
74      */

75     public void setName(String JavaDoc aName)
76     {
77         mName = aName;
78     }
79
80     /**
81      * Sets the value of the attribute.
82      * @param aValue The value to set.
83      */

84     public void setValue(String JavaDoc aValue)
85     {
86         mValue = aValue;
87     }
88
89     /**
90      * Returns the parent of the attribute.
91      * @return the parent of the attribute.
92      */

93     public DetailAST getParent()
94     {
95         return mParent;
96     }
97
98     /**
99      * Sets the parent of the attribute.
100      * @param aParent the parent of the attribute.
101      */

102     public void setParent(DetailAST aParent)
103     {
104         mParent = aParent;
105     }
106
107 }
108
Popular Tags