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
38 public class Tag extends TldItem
39 {
40
41 private String tagClass;
42
43 private String teiClass;
44
45 private String bodycontent;
46
47 private TagAttribute[] attributes;
48
49 private TagVariable[] variables;
50
51 public TagAttribute[] getAttributes()
52 {
53 return this.attributes;
54 }
55
56 public void setAttributes(TagAttribute[] tagAttributes)
57 {
58 this.attributes = tagAttributes;
59 }
60
61 public String getTagClass()
62 {
63 return this.tagClass;
64 }
65
66 public void setTagClass(String className)
67 {
68 this.tagClass = className;
69 }
70
71 public String getTeiClass()
72 {
73 return this.teiClass;
74 }
75
76 public void setTeiClass(String className)
77 {
78 this.teiClass = className;
79 }
80
81 public String getBodycontent()
82 {
83 return this.bodycontent;
84 }
85
86 public void setBodycontent(String bodycontent)
87 {
88 this.bodycontent = bodycontent;
89 }
90
91 public TagVariable[] getVariables()
92 {
93 return this.variables;
94 }
95
96 public void setVariables(TagVariable[] variables)
97 {
98 this.variables = variables;
99 }
100
101
102
103
104 @Override
105 public int compareTo(TldItem object)
106 {
107 int ret = super.compareTo(object);
108 if (ret != 0) {
109 return ret;
110 }
111
112 Tag rhs = (Tag) object;
113 return new CompareToBuilder()
114 .append(this.tagClass, rhs.tagClass)
115 .append(this.teiClass, rhs.teiClass)
116 .append(this.attributes, rhs.attributes)
117 .toComparison();
118 }
119
120
121
122
123 @Override
124 public boolean equals(Object obj)
125 {
126 if(obj == null || !super.equals(obj))
127 {
128 return false;
129 }
130
131 Tag rhs = (Tag) obj;
132 return new EqualsBuilder()
133 .append(this.tagClass, rhs.tagClass)
134 .append(this.teiClass, rhs.teiClass)
135 .append(this.attributes, rhs.attributes)
136 .isEquals();
137 }
138
139
140
141
142 @Override
143 public int hashCode() {
144 return new HashCodeBuilder()
145 .appendSuper(super.hashCode())
146 .append(this.tagClass)
147 .append(this.teiClass)
148 .append(this.attributes)
149 .toHashCode();
150 }
151
152
153
154
155 @Override
156 public String toString()
157 {
158 return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append("name", this.getName())
159 .append("tagClass", this.tagClass).append("teiClass", this.teiClass).append("attributes",
160 this.attributes)
161 .toString();
162 }
163
164 }