1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package net.sf.maventaglib.checker;
25
26 import org.apache.commons.lang3.builder.CompareToBuilder;
27 import org.apache.commons.lang3.builder.EqualsBuilder;
28 import org.apache.commons.lang3.builder.HashCodeBuilder;
29 import org.apache.commons.lang3.builder.ToStringBuilder;
30 import org.apache.commons.lang3.builder.ToStringStyle;
31
32
33
34
35
36
37 public class TagAttribute
38 implements Comparable<TagAttribute>
39 {
40
41 private String name;
42
43 private String type;
44
45 private String description;
46
47 private boolean required;
48
49 private boolean deprecated;
50
51 private boolean rtexprvalue;
52
53 public String getName()
54 {
55 return this.name;
56 }
57
58 public void setName( String attributeName )
59 {
60 this.name = attributeName;
61 }
62
63 public String getType()
64 {
65 return this.type;
66 }
67
68 public void setType( String attributeType )
69 {
70 this.type = attributeType;
71 }
72
73 public boolean isDeprecated()
74 {
75 return this.deprecated;
76 }
77
78 public void setDeprecated( boolean deprecated )
79 {
80 this.deprecated = deprecated;
81 }
82
83 public String getDescription()
84 {
85 return this.description;
86 }
87
88 public void setDescription( String description )
89 {
90 this.description = description;
91 }
92
93 public boolean isRequired()
94 {
95 return this.required;
96 }
97
98 public void setRequired( boolean required )
99 {
100 this.required = required;
101 }
102
103 public boolean isRtexprvalue()
104 {
105 return this.rtexprvalue;
106 }
107
108 public void setRtexprvalue( boolean rtexprvalue )
109 {
110 this.rtexprvalue = rtexprvalue;
111 }
112
113
114
115
116 public int compareTo( TagAttribute object )
117 {
118 return new CompareToBuilder().append( this.deprecated, object.deprecated ).append( this.name, object.name )
119 .toComparison();
120 }
121
122
123
124
125 @Override
126 public boolean equals( Object obj )
127 {
128 if( obj == null )
129 {
130 return false;
131 }
132
133 if( obj == this )
134 {
135 return true;
136 }
137
138 if( obj.getClass() != getClass() )
139 {
140 return false;
141 }
142
143 TagAttribute rhs = (TagAttribute) obj;
144 return new EqualsBuilder().append( this.deprecated, rhs.deprecated ).append( this.name, rhs.name )
145 .isEquals();
146 }
147
148
149
150
151 @Override
152 public int hashCode() {
153 return new HashCodeBuilder().append( this.deprecated ).append( this.name )
154 .toHashCode();
155 }
156
157
158
159
160 @Override
161 public String toString()
162 {
163 return new ToStringBuilder( this, ToStringStyle.SHORT_PREFIX_STYLE ).append( "name", this.name )
164 .append( "description", this.description ).append( "deprecated", this.deprecated ).append( "type",
165 this.type )
166 .append( "required", this.required ).toString();
167 }
168
169 }