1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 package org.w3c.tidy;
55
56 /**
57 * HTML attribute.
58 * @author Dave Raggett <a href="mailto:dsr@w3.org">dsr@w3.org </a>
59 * @author Andy Quick <a href="mailto:ac.quick@sympatico.ca">ac.quick@sympatico.ca </a> (translation to Java)
60 * @author Fabrizio Giustina
61 * @version $Revision: 779 $ ($Author: fgiust $)
62 */
63 public class Attribute
64 {
65
66 /**
67 * attribute name.
68 */
69 private String name;
70
71 /**
72 * don't wrap attribute.
73 */
74 private boolean nowrap;
75
76 /**
77 * unmodifiable attribute?
78 */
79 private boolean literal;
80
81 /**
82 * html versions for this attribute.
83 */
84 private short versions;
85
86 /**
87 * checker for the attribute.
88 */
89 private AttrCheck attrchk;
90
91 /**
92 * Instantiates a new Attribute.
93 * @param attributeName attribute name
94 * @param htmlVersions versions in which this attribute is supported
95 * @param check AttrCheck instance
96 */
97 public Attribute(String attributeName, short htmlVersions, AttrCheck check)
98 {
99 this.name = attributeName;
100 this.versions = htmlVersions;
101 this.attrchk = check;
102 }
103
104 /**
105 * Is this a literal (unmodifiable) attribute?
106 * @param isLiteral boolean <code>true</code> for a literal attribute
107 */
108 public void setLiteral(boolean isLiteral)
109 {
110 this.literal = isLiteral;
111 }
112
113 /**
114 * Don't wrap this attribute?
115 * @param isNowrap boolean <code>true</code>= don't wrap
116 */
117 public void setNowrap(boolean isNowrap)
118 {
119 this.nowrap = isNowrap;
120 }
121
122 /**
123 * Returns the checker for this attribute.
124 * @return instance of AttrCheck.
125 */
126 public AttrCheck getAttrchk()
127 {
128 return this.attrchk;
129 }
130
131 /**
132 * Is this a literal (unmodifiable) attribute?
133 * @return <code>true</code> for a literal attribute
134 */
135 public boolean isLiteral()
136 {
137 return this.literal;
138 }
139
140 /**
141 * Returns the attribute name.
142 * @return attribute name.
143 */
144 public String getName()
145 {
146 return this.name;
147 }
148
149 /**
150 * Don't wrap this attribute?
151 * @return <code>true</code>= don't wrap
152 */
153 public boolean isNowrap()
154 {
155 return this.nowrap;
156 }
157
158 /**
159 * Returns the html versions in which this attribute is supported.
160 * @return html versions for this attribute.
161 * @see Dict
162 */
163 public short getVersions()
164 {
165 return this.versions;
166 }
167
168 }