1 19 20 package org.netbeans.modules.xml.axi.datatype; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import org.netbeans.modules.xml.schema.model.Whitespace; 25 26 34 public class QNameType extends StringBase { 35 36 protected boolean hasFacets; 37 38 private List <Integer > lengths; 39 40 private List <Integer > minLengths; 41 42 private List <Integer > maxLengths; 43 44 private List <String > patterns; 45 46 protected List <String > enumerations; 47 48 private List <Whitespace.Treatment> whitespaces; 49 50 53 public QNameType() { 54 super(Datatype.Kind.QNAME); 55 } 56 57 62 public List <Integer > getLengths() { 63 return lengths; 64 } 65 66 71 public List <Integer > getMinLengths() { 72 return minLengths; 73 } 74 75 80 public List <Integer > getMaxLengths() { 81 return maxLengths; 82 } 83 84 89 public List <String > getPatterns() { 90 return patterns; 91 } 92 93 98 public List <String > getEnumerations() { 99 return enumerations; 100 } 101 102 107 public List <Whitespace.Treatment> getWhiteSpaces() { 108 return whitespaces; 109 } 110 111 116 public void addLength(int length) { 117 if(lengths == null) { 118 lengths = new ArrayList <Integer >(1); 119 hasFacets = true; 120 } 121 this.lengths.add(new Integer (length)); 122 } 123 124 129 public void addMinLength(int minLength) { 130 if(minLengths == null) { 131 minLengths = new ArrayList <Integer >(1); 132 hasFacets = true; 133 } 134 this.minLengths.add(new Integer (minLength)); 135 } 136 137 142 public void addMaxLength(int maxLength) { 143 if(maxLengths == null) { 144 maxLengths = new ArrayList <Integer >(1); 145 hasFacets = true; 146 } 147 this.maxLengths.add(new Integer (maxLength)); 148 } 149 150 155 public void addPattern(String pattern) { 156 if(patterns == null) { 157 patterns = new ArrayList <String >(1); 158 hasFacets = true; 159 } 160 this.patterns.add(pattern); 161 } 162 163 168 public void addEnumeration(String enumeration) { 169 if(enumerations == null) { 170 enumerations = new ArrayList <String >(1); 171 hasFacets = true; 172 } 173 this.enumerations.add(enumeration); 174 } 175 176 181 public void addWhitespace(Whitespace.Treatment whitespace) { 182 if(whitespaces == null) { 183 whitespaces = new ArrayList <Whitespace.Treatment>(1); 184 hasFacets = true; 185 } 186 this.whitespaces.add(whitespace); 187 } 188 189 194 public void removeLength(int length) { 195 if(lengths == null) { 196 lengths = new ArrayList <Integer >(1); 197 hasFacets = true; 198 } 199 this.lengths.remove(new Integer (length)); 200 } 201 202 207 public void removeMinLength(int minLength) { 208 if(minLengths == null) { 209 minLengths = new ArrayList <Integer >(1); 210 hasFacets = true; 211 } 212 this.minLengths.remove(new Integer (minLength)); 213 } 214 215 220 public void removeMaxLength(int maxLength) { 221 if(maxLengths == null) { 222 maxLengths = new ArrayList <Integer >(1); 223 hasFacets = true; 224 } 225 this.maxLengths.remove(new Integer (maxLength)); 226 } 227 228 233 public void removePattern(String pattern) { 234 if(patterns == null) { 235 patterns = new ArrayList <String >(1); 236 hasFacets = true; 237 } 238 this.patterns.remove(pattern); 239 } 240 241 246 public void removeEnumeration(String enumeration) { 247 if(enumerations == null) { 248 enumerations = new ArrayList <String >(1); 249 hasFacets = true; 250 } 251 this.enumerations.remove(enumeration); 252 } 253 254 259 public void removeWhitespace(Whitespace.Treatment whitespace) { 260 if(whitespaces == null) { 261 whitespaces = new ArrayList <Whitespace.Treatment>(1); 262 hasFacets = true; 263 } 264 this.whitespaces.remove(whitespace); 265 } 266 } 267 | Popular Tags |