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 NotationType 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 private List <String > enumerations; 47 48 private List <Whitespace.Treatment> whitespaces; 49 50 53 public NotationType() { 54 super(Datatype.Kind.NOTATION); 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.remove(new Integer (length)); 197 } 198 199 204 public void removeMinLength(int minLength) { 205 if(minLengths != null) 206 minLengths.remove(new Integer (minLength)); 207 } 208 209 214 public void removeMaxLength(int maxLength) { 215 if(maxLengths != null) 216 maxLengths.remove(new Integer (maxLength)); 217 } 218 219 224 public void removePattern(String pattern) { 225 if(patterns != null) 226 patterns.remove(pattern); 227 } 228 229 234 public void removeEnumeration(String enumeration) { 235 if(enumerations != null) 236 enumerations.remove(enumeration); 237 } 238 239 244 public void removeWhitespace(Whitespace.Treatment whitespace) { 245 if(whitespaces != null) 246 whitespaces.remove(whitespace); 247 } 248 } 249 | Popular Tags |