KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > xml > type > util > XMLTypeValidator


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: XMLTypeValidator.java,v 1.8 2005/06/12 13:29:22 emerks Exp $
16  */

17 package org.eclipse.emf.ecore.xml.type.util;
18
19 import java.math.BigDecimal JavaDoc;
20 import java.math.BigInteger JavaDoc;
21
22 import java.util.Iterator JavaDoc;
23 import java.util.List JavaDoc;
24 import java.util.Map JavaDoc;
25
26 import org.eclipse.emf.common.util.DiagnosticChain;
27
28 import org.eclipse.emf.ecore.EPackage;
29
30 import org.eclipse.emf.ecore.util.EObjectValidator;
31
32 import org.eclipse.emf.ecore.xml.type.*;
33
34 /**
35  * <!-- begin-user-doc -->
36  * The <b>Validator</b> for the model.
37  * <!-- end-user-doc -->
38  * @see org.eclipse.emf.ecore.xml.type.XMLTypePackage
39  * @generated
40  */

41 public class XMLTypeValidator extends EObjectValidator
42 {
43   /**
44    * The cached model package
45    * <!-- begin-user-doc -->
46    * <!-- end-user-doc -->
47    * @generated
48    */

49   public static final XMLTypeValidator INSTANCE = new XMLTypeValidator();
50
51   /**
52    * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package.
53    * <!-- begin-user-doc -->
54    * <!-- end-user-doc -->
55    * @see org.eclipse.emf.common.util.Diagnostic#getSource()
56    * @see org.eclipse.emf.common.util.Diagnostic#getCode()
57    * @generated
58    */

59   public static final String JavaDoc DIAGNOSTIC_SOURCE = "org.eclipse.emf.ecore.xml.type";
60
61   /**
62    * A constant with a fixed name that can be used as the base value for additional hand written constants.
63    * <!-- begin-user-doc -->
64    * <!-- end-user-doc -->
65    * @generated
66    */

67   private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0;
68
69   /**
70    * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class.
71    * <!-- begin-user-doc -->
72    * <!-- end-user-doc -->
73    * @generated
74    */

75   protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT;
76
77   /**
78    * Creates an instance of the switch.
79    * <!-- begin-user-doc -->
80    * <!-- end-user-doc -->
81    * @generated
82    */

83   public XMLTypeValidator()
84   {
85     super();
86   }
87
88   /**
89    * Returns the package of this validator switch.
90    * <!-- begin-user-doc -->
91    * <!-- end-user-doc -->
92    * @generated
93    */

94   protected EPackage getEPackage()
95   {
96     return XMLTypePackage.eINSTANCE;
97   }
98
99   /**
100    * Calls <code>validateXXX</code> for the corresonding classifier of the model.
101    * <!-- begin-user-doc -->
102    * <!-- end-user-doc -->
103    * @generated
104    */

105   protected boolean validate(int classifierID, Object JavaDoc value, DiagnosticChain diagnostics, Map JavaDoc context)
106   {
107     switch (classifierID)
108     {
109       case XMLTypePackage.ANY_TYPE:
110         return validateAnyType((AnyType)value, diagnostics, context);
111       case XMLTypePackage.SIMPLE_ANY_TYPE:
112         return validateSimpleAnyType((SimpleAnyType)value, diagnostics, context);
113       case XMLTypePackage.XML_TYPE_DOCUMENT_ROOT:
114         return validateXMLTypeDocumentRoot((XMLTypeDocumentRoot)value, diagnostics, context);
115       case XMLTypePackage.ANY_SIMPLE_TYPE:
116         return validateAnySimpleType(value, diagnostics, context);
117       case XMLTypePackage.ANY_URI:
118         return validateAnyURI((String JavaDoc)value, diagnostics, context);
119       case XMLTypePackage.BASE64_BINARY:
120         return validateBase64Binary((byte[])value, diagnostics, context);
121       case XMLTypePackage.BOOLEAN:
122         return validateBoolean(((Boolean JavaDoc)value).booleanValue(), diagnostics, context);
123       case XMLTypePackage.BOOLEAN_OBJECT:
124         return validateBooleanObject((Boolean JavaDoc)value, diagnostics, context);
125       case XMLTypePackage.BYTE:
126         return validateByte(((Byte JavaDoc)value).byteValue(), diagnostics, context);
127       case XMLTypePackage.BYTE_OBJECT:
128         return validateByteObject((Byte JavaDoc)value, diagnostics, context);
129       case XMLTypePackage.DATE:
130         return validateDate(value, diagnostics, context);
131       case XMLTypePackage.DATE_TIME:
132         return validateDateTime(value, diagnostics, context);
133       case XMLTypePackage.DECIMAL:
134         return validateDecimal((BigDecimal JavaDoc)value, diagnostics, context);
135       case XMLTypePackage.DOUBLE:
136         return validateDouble(((Double JavaDoc)value).doubleValue(), diagnostics, context);
137       case XMLTypePackage.DOUBLE_OBJECT:
138         return validateDoubleObject((Double JavaDoc)value, diagnostics, context);
139       case XMLTypePackage.DURATION:
140         return validateDuration(value, diagnostics, context);
141       case XMLTypePackage.ENTITIES:
142         return validateENTITIES((List JavaDoc)value, diagnostics, context);
143       case XMLTypePackage.ENTITIES_BASE:
144         return validateENTITIESBase((List JavaDoc)value, diagnostics, context);
145       case XMLTypePackage.ENTITY:
146         return validateENTITY((String JavaDoc)value, diagnostics, context);
147       case XMLTypePackage.FLOAT:
148         return validateFloat(((Float JavaDoc)value).floatValue(), diagnostics, context);
149       case XMLTypePackage.FLOAT_OBJECT:
150         return validateFloatObject((Float JavaDoc)value, diagnostics, context);
151       case XMLTypePackage.GDAY:
152         return validateGDay(value, diagnostics, context);
153       case XMLTypePackage.GMONTH:
154         return validateGMonth(value, diagnostics, context);
155       case XMLTypePackage.GMONTH_DAY:
156         return validateGMonthDay(value, diagnostics, context);
157       case XMLTypePackage.GYEAR:
158         return validateGYear(value, diagnostics, context);
159       case XMLTypePackage.GYEAR_MONTH:
160         return validateGYearMonth(value, diagnostics, context);
161       case XMLTypePackage.HEX_BINARY:
162         return validateHexBinary((byte[])value, diagnostics, context);
163       case XMLTypePackage.ID:
164         return validateID((String JavaDoc)value, diagnostics, context);
165       case XMLTypePackage.IDREF:
166         return validateIDREF((String JavaDoc)value, diagnostics, context);
167       case XMLTypePackage.IDREFS:
168         return validateIDREFS((List JavaDoc)value, diagnostics, context);
169       case XMLTypePackage.IDREFS_BASE:
170         return validateIDREFSBase((List JavaDoc)value, diagnostics, context);
171       case XMLTypePackage.INT:
172         return validateInt(((Integer JavaDoc)value).intValue(), diagnostics, context);
173       case XMLTypePackage.INTEGER:
174         return validateInteger((BigInteger JavaDoc)value, diagnostics, context);
175       case XMLTypePackage.INT_OBJECT:
176         return validateIntObject((Integer JavaDoc)value, diagnostics, context);
177       case XMLTypePackage.LANGUAGE:
178         return validateLanguage((String JavaDoc)value, diagnostics, context);
179       case XMLTypePackage.LONG:
180         return validateLong(((Long JavaDoc)value).longValue(), diagnostics, context);
181       case XMLTypePackage.LONG_OBJECT:
182         return validateLongObject((Long JavaDoc)value, diagnostics, context);
183       case XMLTypePackage.NAME:
184         return validateName((String JavaDoc)value, diagnostics, context);
185       case XMLTypePackage.NC_NAME:
186         return validateNCName((String JavaDoc)value, diagnostics, context);
187       case XMLTypePackage.NEGATIVE_INTEGER:
188         return validateNegativeInteger((BigInteger JavaDoc)value, diagnostics, context);
189       case XMLTypePackage.NMTOKEN:
190         return validateNMTOKEN((String JavaDoc)value, diagnostics, context);
191       case XMLTypePackage.NMTOKENS:
192         return validateNMTOKENS((List JavaDoc)value, diagnostics, context);
193       case XMLTypePackage.NMTOKENS_BASE:
194         return validateNMTOKENSBase((List JavaDoc)value, diagnostics, context);
195       case XMLTypePackage.NON_NEGATIVE_INTEGER:
196         return validateNonNegativeInteger((BigInteger JavaDoc)value, diagnostics, context);
197       case XMLTypePackage.NON_POSITIVE_INTEGER:
198         return validateNonPositiveInteger((BigInteger JavaDoc)value, diagnostics, context);
199       case XMLTypePackage.NORMALIZED_STRING:
200         return validateNormalizedString((String JavaDoc)value, diagnostics, context);
201       case XMLTypePackage.NOTATION:
202         return validateNOTATION(value, diagnostics, context);
203       case XMLTypePackage.POSITIVE_INTEGER:
204         return validatePositiveInteger((BigInteger JavaDoc)value, diagnostics, context);
205       case XMLTypePackage.QNAME:
206         return validateQName(value, diagnostics, context);
207       case XMLTypePackage.SHORT:
208         return validateShort(((Short JavaDoc)value).shortValue(), diagnostics, context);
209       case XMLTypePackage.SHORT_OBJECT:
210         return validateShortObject((Short JavaDoc)value, diagnostics, context);
211       case XMLTypePackage.STRING:
212         return validateString((String JavaDoc)value, diagnostics, context);
213       case XMLTypePackage.TIME:
214         return validateTime(value, diagnostics, context);
215       case XMLTypePackage.TOKEN:
216         return validateToken((String JavaDoc)value, diagnostics, context);
217       case XMLTypePackage.UNSIGNED_BYTE:
218         return validateUnsignedByte(((Short JavaDoc)value).shortValue(), diagnostics, context);
219       case XMLTypePackage.UNSIGNED_BYTE_OBJECT:
220         return validateUnsignedByteObject((Short JavaDoc)value, diagnostics, context);
221       case XMLTypePackage.UNSIGNED_INT:
222         return validateUnsignedInt(((Long JavaDoc)value).longValue(), diagnostics, context);
223       case XMLTypePackage.UNSIGNED_INT_OBJECT:
224         return validateUnsignedIntObject((Long JavaDoc)value, diagnostics, context);
225       case XMLTypePackage.UNSIGNED_LONG:
226         return validateUnsignedLong((BigInteger JavaDoc)value, diagnostics, context);
227       case XMLTypePackage.UNSIGNED_SHORT:
228         return validateUnsignedShort(((Integer JavaDoc)value).intValue(), diagnostics, context);
229       case XMLTypePackage.UNSIGNED_SHORT_OBJECT:
230         return validateUnsignedShortObject((Integer JavaDoc)value, diagnostics, context);
231       default:
232         return true;
233     }
234   }
235
236   /**
237    * <!-- begin-user-doc -->
238    * <!-- end-user-doc -->
239    * @generated
240    */

241   public boolean validateAnyType(AnyType anyType, DiagnosticChain diagnostics, Map JavaDoc context)
242   {
243     return validate_EveryDefaultConstraint(anyType, diagnostics, context);
244   }
245
246   /**
247    * <!-- begin-user-doc -->
248    * <!-- end-user-doc -->
249    * @generated
250    */

251   public boolean validateSimpleAnyType(SimpleAnyType simpleAnyType, DiagnosticChain diagnostics, Map JavaDoc context)
252   {
253     return validate_EveryDefaultConstraint(simpleAnyType, diagnostics, context);
254   }
255
256   /**
257    * <!-- begin-user-doc -->
258    * <!-- end-user-doc -->
259    * @generated
260    */

261   public boolean validateXMLTypeDocumentRoot(XMLTypeDocumentRoot xmlTypeDocumentRoot, DiagnosticChain diagnostics, Map JavaDoc context)
262   {
263     return validate_EveryDefaultConstraint(xmlTypeDocumentRoot, diagnostics, context);
264   }
265
266   /**
267    * <!-- begin-user-doc -->
268    * <!-- end-user-doc -->
269    * @generated
270    */

271   public boolean validateAnySimpleType(Object JavaDoc anySimpleType, DiagnosticChain diagnostics, Map JavaDoc context)
272   {
273     return true;
274   }
275
276   /**
277    * <!-- begin-user-doc -->
278    * <!-- end-user-doc -->
279    * @generated
280    */

281   public boolean validateAnyURI(String JavaDoc anyURI, DiagnosticChain diagnostics, Map JavaDoc context)
282   {
283     return true;
284   }
285
286   /**
287    * <!-- begin-user-doc -->
288    * <!-- end-user-doc -->
289    * @generated
290    */

291   public boolean validateBase64Binary(byte[] base64Binary, DiagnosticChain diagnostics, Map JavaDoc context)
292   {
293     return true;
294   }
295
296   /**
297    * <!-- begin-user-doc -->
298    * <!-- end-user-doc -->
299    * @generated
300    */

301   public boolean validateBoolean(boolean boolean_, DiagnosticChain diagnostics, Map JavaDoc context)
302   {
303     return true;
304   }
305
306   /**
307    * <!-- begin-user-doc -->
308    * <!-- end-user-doc -->
309    * @generated
310    */

311   public boolean validateBooleanObject(Boolean JavaDoc booleanObject, DiagnosticChain diagnostics, Map JavaDoc context)
312   {
313     return true;
314   }
315
316   /**
317    * <!-- begin-user-doc -->
318    * <!-- end-user-doc -->
319    * @generated
320    */

321   public boolean validateByte(byte byte_, DiagnosticChain diagnostics, Map JavaDoc context)
322   {
323     return true;
324   }
325
326   /**
327    * <!-- begin-user-doc -->
328    * <!-- end-user-doc -->
329    * @generated
330    */

331   public boolean validateByteObject(Byte JavaDoc byteObject, DiagnosticChain diagnostics, Map JavaDoc context)
332   {
333     return true;
334   }
335
336   /**
337    * <!-- begin-user-doc -->
338    * <!-- end-user-doc -->
339    * @generated
340    */

341   public boolean validateDate(Object JavaDoc date, DiagnosticChain diagnostics, Map JavaDoc context)
342   {
343     return true;
344   }
345
346   /**
347    * <!-- begin-user-doc -->
348    * <!-- end-user-doc -->
349    * @generated
350    */

351   public boolean validateDateTime(Object JavaDoc dateTime, DiagnosticChain diagnostics, Map JavaDoc context)
352   {
353     return true;
354   }
355
356   /**
357    * <!-- begin-user-doc -->
358    * <!-- end-user-doc -->
359    * @generated
360    */

361   public boolean validateDecimal(BigDecimal JavaDoc decimal, DiagnosticChain diagnostics, Map JavaDoc context)
362   {
363     return true;
364   }
365
366   /**
367    * <!-- begin-user-doc -->
368    * <!-- end-user-doc -->
369    * @generated
370    */

371   public boolean validateDouble(double double_, DiagnosticChain diagnostics, Map JavaDoc context)
372   {
373     return true;
374   }
375
376   /**
377    * <!-- begin-user-doc -->
378    * <!-- end-user-doc -->
379    * @generated
380    */

381   public boolean validateDoubleObject(Double JavaDoc doubleObject, DiagnosticChain diagnostics, Map JavaDoc context)
382   {
383     return true;
384   }
385
386   /**
387    * <!-- begin-user-doc -->
388    * <!-- end-user-doc -->
389    * @generated
390    */

391   public boolean validateDuration(Object JavaDoc duration, DiagnosticChain diagnostics, Map JavaDoc context)
392   {
393     return true;
394   }
395
396   /**
397    * <!-- begin-user-doc -->
398    * <!-- end-user-doc -->
399    * @generated
400    */

401   public boolean validateENTITIES(List JavaDoc entities, DiagnosticChain diagnostics, Map JavaDoc context)
402   {
403     boolean result = validateENTITIESBase_ItemType(entities, diagnostics, context);
404     if (result || diagnostics != null) result &= validateENTITIES_MinLength(entities, diagnostics, context);
405     return result;
406   }
407
408   /**
409    * Validates the MinLength constraint of '<em>ENTITIES</em>'.
410    * <!-- begin-user-doc -->
411    * <!-- end-user-doc -->
412    * @generated
413    */

414   public boolean validateENTITIES_MinLength(List JavaDoc entities, DiagnosticChain diagnostics, Map JavaDoc context)
415   {
416     int length = entities.size();
417     boolean result = length >= 1;
418     if (!result && diagnostics != null)
419       reportMinLengthViolation(XMLTypePackage.eINSTANCE.getENTITIES(), entities, length, 1, diagnostics, context);
420     return result;
421   }
422
423   /**
424    * <!-- begin-user-doc -->
425    * <!-- end-user-doc -->
426    * @generated
427    */

428   public boolean validateENTITIESBase(List JavaDoc entitiesBase, DiagnosticChain diagnostics, Map JavaDoc context)
429   {
430     boolean result = validateENTITIESBase_ItemType(entitiesBase, diagnostics, context);
431     return result;
432   }
433
434   /**
435    * Validates the ItemType constraint of '<em>ENTITIES Base</em>'.
436    * <!-- begin-user-doc -->
437    * <!-- end-user-doc -->
438    * @generated
439    */

440   public boolean validateENTITIESBase_ItemType(List JavaDoc entitiesBase, DiagnosticChain diagnostics, Map JavaDoc context)
441   {
442     boolean result = true;
443     for (Iterator JavaDoc i = entitiesBase.iterator(); i.hasNext() && (result || diagnostics != null); )
444     {
445       Object JavaDoc item = i.next();
446       if (XMLTypePackage.eINSTANCE.getENTITY().isInstance(item))
447       {
448         result &= validateENTITY((String JavaDoc)item, diagnostics, context);
449       }
450       else
451       {
452         result = false;
453         reportDataValueTypeViolation(XMLTypePackage.eINSTANCE.getENTITY(), item, diagnostics, context);
454       }
455     }
456     return result;
457   }
458
459   /**
460    * <!-- begin-user-doc -->
461    * <!-- end-user-doc -->
462    * @generated
463    */

464   public boolean validateENTITY(String JavaDoc entity, DiagnosticChain diagnostics, Map JavaDoc context)
465   {
466     boolean result = validateNCName_Pattern(entity, diagnostics, context);
467     return result;
468   }
469
470   /**
471    * <!-- begin-user-doc -->
472    * <!-- end-user-doc -->
473    * @generated
474    */

475   public boolean validateFloat(float float_, DiagnosticChain diagnostics, Map JavaDoc context)
476   {
477     return true;
478   }
479
480   /**
481    * <!-- begin-user-doc -->
482    * <!-- end-user-doc -->
483    * @generated
484    */

485   public boolean validateFloatObject(Float JavaDoc floatObject, DiagnosticChain diagnostics, Map JavaDoc context)
486   {
487     return true;
488   }
489
490   /**
491    * <!-- begin-user-doc -->
492    * <!-- end-user-doc -->
493    * @generated
494    */

495   public boolean validateGDay(Object JavaDoc gDay, DiagnosticChain diagnostics, Map JavaDoc context)
496   {
497     return true;
498   }
499
500   /**
501    * <!-- begin-user-doc -->
502    * <!-- end-user-doc -->
503    * @generated
504    */

505   public boolean validateGMonth(Object JavaDoc gMonth, DiagnosticChain diagnostics, Map JavaDoc context)
506   {
507     return true;
508   }
509
510   /**
511    * <!-- begin-user-doc -->
512    * <!-- end-user-doc -->
513    * @generated
514    */

515   public boolean validateGMonthDay(Object JavaDoc gMonthDay, DiagnosticChain diagnostics, Map JavaDoc context)
516   {
517     return true;
518   }
519
520   /**
521    * <!-- begin-user-doc -->
522    * <!-- end-user-doc -->
523    * @generated
524    */

525   public boolean validateGYear(Object JavaDoc gYear, DiagnosticChain diagnostics, Map JavaDoc context)
526   {
527     return true;
528   }
529
530   /**
531    * <!-- begin-user-doc -->
532    * <!-- end-user-doc -->
533    * @generated
534    */

535   public boolean validateGYearMonth(Object JavaDoc gYearMonth, DiagnosticChain diagnostics, Map JavaDoc context)
536   {
537     return true;
538   }
539
540   /**
541    * <!-- begin-user-doc -->
542    * <!-- end-user-doc -->
543    * @generated
544    */

545   public boolean validateHexBinary(byte[] hexBinary, DiagnosticChain diagnostics, Map JavaDoc context)
546   {
547     return true;
548   }
549
550   /**
551    * <!-- begin-user-doc -->
552    * <!-- end-user-doc -->
553    * @generated
554    */

555   public boolean validateID(String JavaDoc id, DiagnosticChain diagnostics, Map JavaDoc context)
556   {
557     boolean result = validateNCName_Pattern(id, diagnostics, context);
558     return result;
559   }
560
561   /**
562    * <!-- begin-user-doc -->
563    * <!-- end-user-doc -->
564    * @generated
565    */

566   public boolean validateIDREF(String JavaDoc idref, DiagnosticChain diagnostics, Map JavaDoc context)
567   {
568     boolean result = validateNCName_Pattern(idref, diagnostics, context);
569     return result;
570   }
571
572   /**
573    * <!-- begin-user-doc -->
574    * <!-- end-user-doc -->
575    * @generated
576    */

577   public boolean validateIDREFS(List JavaDoc idrefs, DiagnosticChain diagnostics, Map JavaDoc context)
578   {
579     boolean result = validateIDREFSBase_ItemType(idrefs, diagnostics, context);
580     if (result || diagnostics != null) result &= validateIDREFS_MinLength(idrefs, diagnostics, context);
581     return result;
582   }
583
584   /**
585    * Validates the MinLength constraint of '<em>IDREFS</em>'.
586    * <!-- begin-user-doc -->
587    * <!-- end-user-doc -->
588    * @generated
589    */

590   public boolean validateIDREFS_MinLength(List JavaDoc idrefs, DiagnosticChain diagnostics, Map JavaDoc context)
591   {
592     int length = idrefs.size();
593     boolean result = length >= 1;
594     if (!result && diagnostics != null)
595       reportMinLengthViolation(XMLTypePackage.eINSTANCE.getIDREFS(), idrefs, length, 1, diagnostics, context);
596     return result;
597   }
598
599   /**
600    * <!-- begin-user-doc -->
601    * <!-- end-user-doc -->
602    * @generated
603    */

604   public boolean validateIDREFSBase(List JavaDoc idrefsBase, DiagnosticChain diagnostics, Map JavaDoc context)
605   {
606     boolean result = validateIDREFSBase_ItemType(idrefsBase, diagnostics, context);
607     return result;
608   }
609
610   /**
611    * Validates the ItemType constraint of '<em>IDREFS Base</em>'.
612    * <!-- begin-user-doc -->
613    * <!-- end-user-doc -->
614    * @generated
615    */

616   public boolean validateIDREFSBase_ItemType(List JavaDoc idrefsBase, DiagnosticChain diagnostics, Map JavaDoc context)
617   {
618     boolean result = true;
619     for (Iterator JavaDoc i = idrefsBase.iterator(); i.hasNext() && (result || diagnostics != null); )
620     {
621       Object JavaDoc item = i.next();
622       if (XMLTypePackage.eINSTANCE.getIDREF().isInstance(item))
623       {
624         result &= validateIDREF((String JavaDoc)item, diagnostics, context);
625       }
626       else
627       {
628         result = false;
629         reportDataValueTypeViolation(XMLTypePackage.eINSTANCE.getIDREF(), item, diagnostics, context);
630       }
631     }
632     return result;
633   }
634
635   /**
636    * <!-- begin-user-doc -->
637    * <!-- end-user-doc -->
638    * @generated
639    */

640   public boolean validateInt(int int_, DiagnosticChain diagnostics, Map JavaDoc context)
641   {
642     return true;
643   }
644
645   /**
646    * <!-- begin-user-doc -->
647    * <!-- end-user-doc -->
648    * @generated
649    */

650   public boolean validateInteger(BigInteger JavaDoc integer, DiagnosticChain diagnostics, Map JavaDoc context)
651   {
652     return true;
653   }
654
655   /**
656    * <!-- begin-user-doc -->
657    * <!-- end-user-doc -->
658    * @generated
659    */

660   public boolean validateIntObject(Integer JavaDoc intObject, DiagnosticChain diagnostics, Map JavaDoc context)
661   {
662     return true;
663   }
664
665   /**
666    * <!-- begin-user-doc -->
667    * <!-- end-user-doc -->
668    * @generated
669    */

670   public boolean validateLanguage(String JavaDoc language, DiagnosticChain diagnostics, Map JavaDoc context)
671   {
672     boolean result = validateLanguage_Pattern(language, diagnostics, context);
673     return result;
674   }
675
676   /**
677    * <!-- begin-user-doc -->
678    * <!-- end-user-doc -->
679    * @generated
680    * @see #validateLanguage_Pattern
681    */

682   public static final PatternMatcher [][] LANGUAGE__PATTERN__VALUES =
683     new PatternMatcher [][]
684     {
685       new PatternMatcher []
686       {
687         XMLTypeUtil.createPatternMatcher("[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*")
688       }
689     };
690
691   /**
692    * Validates the Pattern constraint of '<em>Language</em>'.
693    * <!-- begin-user-doc -->
694    * <!-- end-user-doc -->
695    * @generated
696    */

697   public boolean validateLanguage_Pattern(String JavaDoc language, DiagnosticChain diagnostics, Map JavaDoc context)
698   {
699     return validatePattern(XMLTypePackage.eINSTANCE.getLanguage(), language, LANGUAGE__PATTERN__VALUES, diagnostics, context);
700   }
701
702   /**
703    * <!-- begin-user-doc -->
704    * <!-- end-user-doc -->
705    * @generated
706    */

707   public boolean validateLong(long long_, DiagnosticChain diagnostics, Map JavaDoc context)
708   {
709     return true;
710   }
711
712   /**
713    * <!-- begin-user-doc -->
714    * <!-- end-user-doc -->
715    * @generated
716    */

717   public boolean validateLongObject(Long JavaDoc longObject, DiagnosticChain diagnostics, Map JavaDoc context)
718   {
719     return true;
720   }
721
722   /**
723    * <!-- begin-user-doc -->
724    * <!-- end-user-doc -->
725    * @generated
726    */

727   public boolean validateName(String JavaDoc name, DiagnosticChain diagnostics, Map JavaDoc context)
728   {
729     boolean result = validateName_Pattern(name, diagnostics, context);
730     return result;
731   }
732
733   /**
734    * <!-- begin-user-doc -->
735    * <!-- end-user-doc -->
736    * @generated
737    * @see #validateName_Pattern
738    */

739   public static final PatternMatcher [][] NAME__PATTERN__VALUES =
740     new PatternMatcher [][]
741     {
742       new PatternMatcher []
743       {
744         XMLTypeUtil.createPatternMatcher("\\i\\c*")
745       }
746     };
747
748   /**
749    * Validates the Pattern constraint of '<em>Name</em>'.
750    * <!-- begin-user-doc -->
751    * <!-- end-user-doc -->
752    * @generated
753    */

754   public boolean validateName_Pattern(String JavaDoc name, DiagnosticChain diagnostics, Map JavaDoc context)
755   {
756     return validatePattern(XMLTypePackage.eINSTANCE.getName_(), name, NAME__PATTERN__VALUES, diagnostics, context);
757   }
758
759   /**
760    * <!-- begin-user-doc -->
761    * <!-- end-user-doc -->
762    * @generated
763    */

764   public boolean validateNCName(String JavaDoc ncName, DiagnosticChain diagnostics, Map JavaDoc context)
765   {
766     boolean result = validateNCName_Pattern(ncName, diagnostics, context);
767     return result;
768   }
769
770   /**
771    * <!-- begin-user-doc -->
772    * <!-- end-user-doc -->
773    * @generated
774    * @see #validateNCName_Pattern
775    */

776   public static final PatternMatcher [][] NC_NAME__PATTERN__VALUES =
777     new PatternMatcher [][]
778     {
779       new PatternMatcher []
780       {
781         XMLTypeUtil.createPatternMatcher("[\\i-[:]][\\c-[:]]*")
782       },
783       new PatternMatcher []
784       {
785         XMLTypeUtil.createPatternMatcher("\\i\\c*")
786       }
787     };
788
789   /**
790    * Validates the Pattern constraint of '<em>NC Name</em>'.
791    * <!-- begin-user-doc -->
792    * <!-- end-user-doc -->
793    * @generated
794    */

795   public boolean validateNCName_Pattern(String JavaDoc ncName, DiagnosticChain diagnostics, Map JavaDoc context)
796   {
797     return validatePattern(XMLTypePackage.eINSTANCE.getNCName(), ncName, NC_NAME__PATTERN__VALUES, diagnostics, context);
798   }
799
800   /**
801    * <!-- begin-user-doc -->
802    * <!-- end-user-doc -->
803    * @generated
804    */

805   public boolean validateNegativeInteger(BigInteger JavaDoc negativeInteger, DiagnosticChain diagnostics, Map JavaDoc context)
806   {
807     boolean result = validateNegativeInteger_Max(negativeInteger, diagnostics, context);
808     return result;
809   }
810
811   /**
812    * <!-- begin-user-doc -->
813    * <!-- end-user-doc -->
814    * @generated
815    * @see #validateNegativeInteger_Max
816    */

817   public static final BigInteger JavaDoc NEGATIVE_INTEGER__MAX__VALUE = new BigInteger JavaDoc("-1");
818
819   /**
820    * Validates the Max constraint of '<em>Negative Integer</em>'.
821    * <!-- begin-user-doc -->
822    * <!-- end-user-doc -->
823    * @generated
824    */

825   public boolean validateNegativeInteger_Max(BigInteger JavaDoc negativeInteger, DiagnosticChain diagnostics, Map JavaDoc context)
826   {
827     boolean result = negativeInteger.compareTo(NEGATIVE_INTEGER__MAX__VALUE) <= 0;
828     if (!result && diagnostics != null)
829       reportMaxViolation(XMLTypePackage.eINSTANCE.getNegativeInteger(), negativeInteger, NEGATIVE_INTEGER__MAX__VALUE, true, diagnostics, context);
830     return result;
831   }
832
833   /**
834    * <!-- begin-user-doc -->
835    * <!-- end-user-doc -->
836    * @generated
837    */

838   public boolean validateNMTOKEN(String JavaDoc nmtoken, DiagnosticChain diagnostics, Map JavaDoc context)
839   {
840     boolean result = validateNMTOKEN_Pattern(nmtoken, diagnostics, context);
841     return result;
842   }
843
844   /**
845    * <!-- begin-user-doc -->
846    * <!-- end-user-doc -->
847    * @generated
848    * @see #validateNMTOKEN_Pattern
849    */

850   public static final PatternMatcher [][] NMTOKEN__PATTERN__VALUES =
851     new PatternMatcher [][]
852     {
853       new PatternMatcher []
854       {
855         XMLTypeUtil.createPatternMatcher("\\c+")
856       }
857     };
858
859   /**
860    * Validates the Pattern constraint of '<em>NMTOKEN</em>'.
861    * <!-- begin-user-doc -->
862    * <!-- end-user-doc -->
863    * @generated
864    */

865   public boolean validateNMTOKEN_Pattern(String JavaDoc nmtoken, DiagnosticChain diagnostics, Map JavaDoc context)
866   {
867     return validatePattern(XMLTypePackage.eINSTANCE.getNMTOKEN(), nmtoken, NMTOKEN__PATTERN__VALUES, diagnostics, context);
868   }
869
870   /**
871    * <!-- begin-user-doc -->
872    * <!-- end-user-doc -->
873    * @generated
874    */

875   public boolean validateNMTOKENS(List JavaDoc nmtokens, DiagnosticChain diagnostics, Map JavaDoc context)
876   {
877     boolean result = validateNMTOKENSBase_ItemType(nmtokens, diagnostics, context);
878     if (result || diagnostics != null) result &= validateNMTOKENS_MinLength(nmtokens, diagnostics, context);
879     return result;
880   }
881
882   /**
883    * Validates the MinLength constraint of '<em>NMTOKENS</em>'.
884    * <!-- begin-user-doc -->
885    * <!-- end-user-doc -->
886    * @generated
887    */

888   public boolean validateNMTOKENS_MinLength(List JavaDoc nmtokens, DiagnosticChain diagnostics, Map JavaDoc context)
889   {
890     int length = nmtokens.size();
891     boolean result = length >= 1;
892     if (!result && diagnostics != null)
893       reportMinLengthViolation(XMLTypePackage.eINSTANCE.getNMTOKENS(), nmtokens, length, 1, diagnostics, context);
894     return result;
895   }
896
897   /**
898    * <!-- begin-user-doc -->
899    * <!-- end-user-doc -->
900    * @generated
901    */

902   public boolean validateNMTOKENSBase(List JavaDoc nmtokensBase, DiagnosticChain diagnostics, Map JavaDoc context)
903   {
904     boolean result = validateNMTOKENSBase_ItemType(nmtokensBase, diagnostics, context);
905     return result;
906   }
907
908   /**
909    * Validates the ItemType constraint of '<em>NMTOKENS Base</em>'.
910    * <!-- begin-user-doc -->
911    * <!-- end-user-doc -->
912    * @generated
913    */

914   public boolean validateNMTOKENSBase_ItemType(List JavaDoc nmtokensBase, DiagnosticChain diagnostics, Map JavaDoc context)
915   {
916     boolean result = true;
917     for (Iterator JavaDoc i = nmtokensBase.iterator(); i.hasNext() && (result || diagnostics != null); )
918     {
919       Object JavaDoc item = i.next();
920       if (XMLTypePackage.eINSTANCE.getNMTOKEN().isInstance(item))
921       {
922         result &= validateNMTOKEN((String JavaDoc)item, diagnostics, context);
923       }
924       else
925       {
926         result = false;
927         reportDataValueTypeViolation(XMLTypePackage.eINSTANCE.getNMTOKEN(), item, diagnostics, context);
928       }
929     }
930     return result;
931   }
932
933   /**
934    * <!-- begin-user-doc -->
935    * <!-- end-user-doc -->
936    * @generated
937    */

938   public boolean validateNonNegativeInteger(BigInteger JavaDoc nonNegativeInteger, DiagnosticChain diagnostics, Map JavaDoc context)
939   {
940     boolean result = validateNonNegativeInteger_Min(nonNegativeInteger, diagnostics, context);
941     return result;
942   }
943
944   /**
945    * <!-- begin-user-doc -->
946    * <!-- end-user-doc -->
947    * @generated
948    * @see #validateNonNegativeInteger_Min
949    */

950   public static final BigInteger JavaDoc NON_NEGATIVE_INTEGER__MIN__VALUE = new BigInteger JavaDoc("0");
951
952   /**
953    * Validates the Min constraint of '<em>Non Negative Integer</em>'.
954    * <!-- begin-user-doc -->
955    * <!-- end-user-doc -->
956    * @generated
957    */

958   public boolean validateNonNegativeInteger_Min(BigInteger JavaDoc nonNegativeInteger, DiagnosticChain diagnostics, Map JavaDoc context)
959   {
960     boolean result = nonNegativeInteger.compareTo(NON_NEGATIVE_INTEGER__MIN__VALUE) >= 0;
961     if (!result && diagnostics != null)
962       reportMinViolation(XMLTypePackage.eINSTANCE.getNonNegativeInteger(), nonNegativeInteger, NON_NEGATIVE_INTEGER__MIN__VALUE, true, diagnostics, context);
963     return result;
964   }
965
966   /**
967    * <!-- begin-user-doc -->
968    * <!-- end-user-doc -->
969    * @generated
970    */

971   public boolean validateNonPositiveInteger(BigInteger JavaDoc nonPositiveInteger, DiagnosticChain diagnostics, Map JavaDoc context)
972   {
973     boolean result = validateNonPositiveInteger_Max(nonPositiveInteger, diagnostics, context);
974     return result;
975   }
976
977   /**
978    * <!-- begin-user-doc -->
979    * <!-- end-user-doc -->
980    * @generated
981    * @see #validateNonPositiveInteger_Max
982    */

983   public static final BigInteger JavaDoc NON_POSITIVE_INTEGER__MAX__VALUE = new BigInteger JavaDoc("0");
984
985   /**
986    * Validates the Max constraint of '<em>Non Positive Integer</em>'.
987    * <!-- begin-user-doc -->
988    * <!-- end-user-doc -->
989    * @generated
990    */

991   public boolean validateNonPositiveInteger_Max(BigInteger JavaDoc nonPositiveInteger, DiagnosticChain diagnostics, Map JavaDoc context)
992   {
993     boolean result = nonPositiveInteger.compareTo(NON_POSITIVE_INTEGER__MAX__VALUE) <= 0;
994     if (!result && diagnostics != null)
995       reportMaxViolation(XMLTypePackage.eINSTANCE.getNonPositiveInteger(), nonPositiveInteger, NON_POSITIVE_INTEGER__MAX__VALUE, true, diagnostics, context);
996     return result;
997   }
998
999   /**
1000   * <!-- begin-user-doc -->
1001   * <!-- end-user-doc -->
1002   * @generated
1003   */

1004  public boolean validateNormalizedString(String JavaDoc normalizedString, DiagnosticChain diagnostics, Map JavaDoc context)
1005  {
1006    return true;
1007  }
1008
1009  /**
1010   * <!-- begin-user-doc -->
1011   * <!-- end-user-doc -->
1012   * @generated
1013   */

1014  public boolean validateNOTATION(Object JavaDoc notation, DiagnosticChain diagnostics, Map JavaDoc context)
1015  {
1016    return true;
1017  }
1018
1019  /**
1020   * <!-- begin-user-doc -->
1021   * <!-- end-user-doc -->
1022   * @generated
1023   */

1024  public boolean validatePositiveInteger(BigInteger JavaDoc positiveInteger, DiagnosticChain diagnostics, Map JavaDoc context)
1025  {
1026    boolean result = validatePositiveInteger_Min(positiveInteger, diagnostics, context);
1027    return result;
1028  }
1029
1030  /**
1031   * <!-- begin-user-doc -->
1032   * <!-- end-user-doc -->
1033   * @generated
1034   * @see #validatePositiveInteger_Min
1035   */

1036  public static final BigInteger JavaDoc POSITIVE_INTEGER__MIN__VALUE = new BigInteger JavaDoc("1");
1037
1038  /**
1039   * Validates the Min constraint of '<em>Positive Integer</em>'.
1040   * <!-- begin-user-doc -->
1041   * <!-- end-user-doc -->
1042   * @generated
1043   */

1044  public boolean validatePositiveInteger_Min(BigInteger JavaDoc positiveInteger, DiagnosticChain diagnostics, Map JavaDoc context)
1045  {
1046    boolean result = positiveInteger.compareTo(POSITIVE_INTEGER__MIN__VALUE) >= 0;
1047    if (!result && diagnostics != null)
1048      reportMinViolation(XMLTypePackage.eINSTANCE.getPositiveInteger(), positiveInteger, POSITIVE_INTEGER__MIN__VALUE, true, diagnostics, context);
1049    return result;
1050  }
1051
1052  /**
1053   * <!-- begin-user-doc -->
1054   * <!-- end-user-doc -->
1055   * @generated
1056   */

1057  public boolean validateQName(Object JavaDoc qName, DiagnosticChain diagnostics, Map JavaDoc context)
1058  {
1059    return true;
1060  }
1061
1062  /**
1063   * <!-- begin-user-doc -->
1064   * <!-- end-user-doc -->
1065   * @generated
1066   */

1067  public boolean validateShort(short short_, DiagnosticChain diagnostics, Map JavaDoc context)
1068  {
1069    return true;
1070  }
1071
1072  /**
1073   * <!-- begin-user-doc -->
1074   * <!-- end-user-doc -->
1075   * @generated
1076   */

1077  public boolean validateShortObject(Short JavaDoc shortObject, DiagnosticChain diagnostics, Map JavaDoc context)
1078  {
1079    return true;
1080  }
1081
1082  /**
1083   * <!-- begin-user-doc -->
1084   * <!-- end-user-doc -->
1085   * @generated
1086   */

1087  public boolean validateString(String JavaDoc string, DiagnosticChain diagnostics, Map JavaDoc context)
1088  {
1089    return true;
1090  }
1091
1092  /**
1093   * <!-- begin-user-doc -->
1094   * <!-- end-user-doc -->
1095   * @generated
1096   */

1097  public boolean validateTime(Object JavaDoc time, DiagnosticChain diagnostics, Map JavaDoc context)
1098  {
1099    return true;
1100  }
1101
1102  /**
1103   * <!-- begin-user-doc -->
1104   * <!-- end-user-doc -->
1105   * @generated
1106   */

1107  public boolean validateToken(String JavaDoc token, DiagnosticChain diagnostics, Map JavaDoc context)
1108  {
1109    return true;
1110  }
1111
1112  /**
1113   * <!-- begin-user-doc -->
1114   * <!-- end-user-doc -->
1115   * @generated
1116   */

1117  public boolean validateUnsignedByte(short unsignedByte, DiagnosticChain diagnostics, Map JavaDoc context)
1118  {
1119    boolean result = validateUnsignedByte_Min(unsignedByte, diagnostics, context);
1120    if (result || diagnostics != null) result &= validateUnsignedByte_Max(unsignedByte, diagnostics, context);
1121    return result;
1122  }
1123
1124  /**
1125   * <!-- begin-user-doc -->
1126   * <!-- end-user-doc -->
1127   * @generated
1128   * @see #validateUnsignedByte_Min
1129   */

1130  public static final short UNSIGNED_BYTE__MIN__VALUE = 0;
1131
1132  /**
1133   * Validates the Min constraint of '<em>Unsigned Byte</em>'.
1134   * <!-- begin-user-doc -->
1135   * <!-- end-user-doc -->
1136   * @generated
1137   */

1138  public boolean validateUnsignedByte_Min(short unsignedByte, DiagnosticChain diagnostics, Map JavaDoc context)
1139  {
1140    boolean result = unsignedByte >= UNSIGNED_BYTE__MIN__VALUE;
1141    if (!result && diagnostics != null)
1142      reportMinViolation(XMLTypePackage.eINSTANCE.getUnsignedByte(), new Short JavaDoc(unsignedByte), new Short JavaDoc(UNSIGNED_BYTE__MIN__VALUE), true, diagnostics, context);
1143    return result;
1144  }
1145
1146  /**
1147   * <!-- begin-user-doc -->
1148   * <!-- end-user-doc -->
1149   * @generated
1150   * @see #validateUnsignedByte_Max
1151   */

1152  public static final short UNSIGNED_BYTE__MAX__VALUE = 255;
1153
1154  /**
1155   * Validates the Max constraint of '<em>Unsigned Byte</em>'.
1156   * <!-- begin-user-doc -->
1157   * <!-- end-user-doc -->
1158   * @generated
1159   */

1160  public boolean validateUnsignedByte_Max(short unsignedByte, DiagnosticChain diagnostics, Map JavaDoc context)
1161  {
1162    boolean result = unsignedByte <= UNSIGNED_BYTE__MAX__VALUE;
1163    if (!result && diagnostics != null)
1164      reportMaxViolation(XMLTypePackage.eINSTANCE.getUnsignedByte(), new Short JavaDoc(unsignedByte), new Short JavaDoc(UNSIGNED_BYTE__MAX__VALUE), true, diagnostics, context);
1165    return result;
1166  }
1167
1168  /**
1169   * <!-- begin-user-doc -->
1170   * <!-- end-user-doc -->
1171   * @generated
1172   */

1173  public boolean validateUnsignedByteObject(Short JavaDoc unsignedByteObject, DiagnosticChain diagnostics, Map JavaDoc context)
1174  {
1175    boolean result = validateUnsignedByte_Min(unsignedByteObject.shortValue(), diagnostics, context);
1176    if (result || diagnostics != null) result &= validateUnsignedByte_Max(unsignedByteObject.shortValue(), diagnostics, context);
1177    return result;
1178  }
1179
1180  /**
1181   * <!-- begin-user-doc -->
1182   * <!-- end-user-doc -->
1183   * @generated
1184   */

1185  public boolean validateUnsignedInt(long unsignedInt, DiagnosticChain diagnostics, Map JavaDoc context)
1186  {
1187    boolean result = validateUnsignedInt_Min(unsignedInt, diagnostics, context);
1188    if (result || diagnostics != null) result &= validateUnsignedInt_Max(unsignedInt, diagnostics, context);
1189    return result;
1190  }
1191
1192  /**
1193   * <!-- begin-user-doc -->
1194   * <!-- end-user-doc -->
1195   * @generated
1196   * @see #validateUnsignedInt_Min
1197   */

1198  public static final long UNSIGNED_INT__MIN__VALUE = 0L;
1199
1200  /**
1201   * Validates the Min constraint of '<em>Unsigned Int</em>'.
1202   * <!-- begin-user-doc -->
1203   * <!-- end-user-doc -->
1204   * @generated
1205   */

1206  public boolean validateUnsignedInt_Min(long unsignedInt, DiagnosticChain diagnostics, Map JavaDoc context)
1207  {
1208    boolean result = unsignedInt >= UNSIGNED_INT__MIN__VALUE;
1209    if (!result && diagnostics != null)
1210      reportMinViolation(XMLTypePackage.eINSTANCE.getUnsignedInt(), new Long JavaDoc(unsignedInt), new Long JavaDoc(UNSIGNED_INT__MIN__VALUE), true, diagnostics, context);
1211    return result;
1212  }
1213
1214  /**
1215   * <!-- begin-user-doc -->
1216   * <!-- end-user-doc -->
1217   * @generated
1218   * @see #validateUnsignedInt_Max
1219   */

1220  public static final long UNSIGNED_INT__MAX__VALUE = 4294967295L;
1221
1222  /**
1223   * Validates the Max constraint of '<em>Unsigned Int</em>'.
1224   * <!-- begin-user-doc -->
1225   * <!-- end-user-doc -->
1226   * @generated
1227   */

1228  public boolean validateUnsignedInt_Max(long unsignedInt, DiagnosticChain diagnostics, Map JavaDoc context)
1229  {
1230    boolean result = unsignedInt <= UNSIGNED_INT__MAX__VALUE;
1231    if (!result && diagnostics != null)
1232      reportMaxViolation(XMLTypePackage.eINSTANCE.getUnsignedInt(), new Long JavaDoc(unsignedInt), new Long JavaDoc(UNSIGNED_INT__MAX__VALUE), true, diagnostics, context);
1233    return result;
1234  }
1235
1236  /**
1237   * <!-- begin-user-doc -->
1238   * <!-- end-user-doc -->
1239   * @generated
1240   */

1241  public boolean validateUnsignedIntObject(Long JavaDoc unsignedIntObject, DiagnosticChain diagnostics, Map JavaDoc context)
1242  {
1243    boolean result = validateUnsignedInt_Min(unsignedIntObject.longValue(), diagnostics, context);
1244    if (result || diagnostics != null) result &= validateUnsignedInt_Max(unsignedIntObject.longValue(), diagnostics, context);
1245    return result;
1246  }
1247
1248  /**
1249   * <!-- begin-user-doc -->
1250   * <!-- end-user-doc -->
1251   * @generated
1252   */

1253  public boolean validateUnsignedLong(BigInteger JavaDoc unsignedLong, DiagnosticChain diagnostics, Map JavaDoc context)
1254  {
1255    boolean result = validateUnsignedLong_Min(unsignedLong, diagnostics, context);
1256    if (result || diagnostics != null) result &= validateUnsignedLong_Max(unsignedLong, diagnostics, context);
1257    return result;
1258  }
1259
1260  /**
1261   * <!-- begin-user-doc -->
1262   * <!-- end-user-doc -->
1263   * @generated
1264   * @see #validateUnsignedLong_Min
1265   */

1266  public static final BigInteger JavaDoc UNSIGNED_LONG__MIN__VALUE = new BigInteger JavaDoc("0");
1267
1268  /**
1269   * Validates the Min constraint of '<em>Unsigned Long</em>'.
1270   * <!-- begin-user-doc -->
1271   * <!-- end-user-doc -->
1272   * @generated
1273   */

1274  public boolean validateUnsignedLong_Min(BigInteger JavaDoc unsignedLong, DiagnosticChain diagnostics, Map JavaDoc context)
1275  {
1276    boolean result = unsignedLong.compareTo(UNSIGNED_LONG__MIN__VALUE) >= 0;
1277    if (!result && diagnostics != null)
1278      reportMinViolation(XMLTypePackage.eINSTANCE.getUnsignedLong(), unsignedLong, UNSIGNED_LONG__MIN__VALUE, true, diagnostics, context);
1279    return result;
1280  }
1281
1282  /**
1283   * <!-- begin-user-doc -->
1284   * <!-- end-user-doc -->
1285   * @generated
1286   * @see #validateUnsignedLong_Max
1287   */

1288  public static final BigInteger JavaDoc UNSIGNED_LONG__MAX__VALUE = new BigInteger JavaDoc("18446744073709551615");
1289
1290  /**
1291   * Validates the Max constraint of '<em>Unsigned Long</em>'.
1292   * <!-- begin-user-doc -->
1293   * <!-- end-user-doc -->
1294   * @generated
1295   */

1296  public boolean validateUnsignedLong_Max(BigInteger JavaDoc unsignedLong, DiagnosticChain diagnostics, Map JavaDoc context)
1297  {
1298    boolean result = unsignedLong.compareTo(UNSIGNED_LONG__MAX__VALUE) <= 0;
1299    if (!result && diagnostics != null)
1300      reportMaxViolation(XMLTypePackage.eINSTANCE.getUnsignedLong(), unsignedLong, UNSIGNED_LONG__MAX__VALUE, true, diagnostics, context);
1301    return result;
1302  }
1303
1304  /**
1305   * <!-- begin-user-doc -->
1306   * <!-- end-user-doc -->
1307   * @generated
1308   */

1309  public boolean validateUnsignedShort(int unsignedShort, DiagnosticChain diagnostics, Map JavaDoc context)
1310  {
1311    boolean result = validateUnsignedShort_Min(unsignedShort, diagnostics, context);
1312    if (result || diagnostics != null) result &= validateUnsignedShort_Max(unsignedShort, diagnostics, context);
1313    return result;
1314  }
1315
1316  /**
1317   * <!-- begin-user-doc -->
1318   * <!-- end-user-doc -->
1319   * @generated
1320   * @see #validateUnsignedShort_Min
1321   */

1322  public static final int UNSIGNED_SHORT__MIN__VALUE = 0;
1323
1324  /**
1325   * Validates the Min constraint of '<em>Unsigned Short</em>'.
1326   * <!-- begin-user-doc -->
1327   * <!-- end-user-doc -->
1328   * @generated
1329   */

1330  public boolean validateUnsignedShort_Min(int unsignedShort, DiagnosticChain diagnostics, Map JavaDoc context)
1331  {
1332    boolean result = unsignedShort >= UNSIGNED_SHORT__MIN__VALUE;
1333    if (!result && diagnostics != null)
1334      reportMinViolation(XMLTypePackage.eINSTANCE.getUnsignedShort(), new Integer JavaDoc(unsignedShort), new Integer JavaDoc(UNSIGNED_SHORT__MIN__VALUE), true, diagnostics, context);
1335    return result;
1336  }
1337
1338  /**
1339   * <!-- begin-user-doc -->
1340   * <!-- end-user-doc -->
1341   * @generated
1342   * @see #validateUnsignedShort_Max
1343   */

1344  public static final int UNSIGNED_SHORT__MAX__VALUE = 65535;
1345
1346  /**
1347   * Validates the Max constraint of '<em>Unsigned Short</em>'.
1348   * <!-- begin-user-doc -->
1349   * <!-- end-user-doc -->
1350   * @generated
1351   */

1352  public boolean validateUnsignedShort_Max(int unsignedShort, DiagnosticChain diagnostics, Map JavaDoc context)
1353  {
1354    boolean result = unsignedShort <= UNSIGNED_SHORT__MAX__VALUE;
1355    if (!result && diagnostics != null)
1356      reportMaxViolation(XMLTypePackage.eINSTANCE.getUnsignedShort(), new Integer JavaDoc(unsignedShort), new Integer JavaDoc(UNSIGNED_SHORT__MAX__VALUE), true, diagnostics, context);
1357    return result;
1358  }
1359
1360  /**
1361   * <!-- begin-user-doc -->
1362   * <!-- end-user-doc -->
1363   * @generated
1364   */

1365  public boolean validateUnsignedShortObject(Integer JavaDoc unsignedShortObject, DiagnosticChain diagnostics, Map JavaDoc context)
1366  {
1367    boolean result = validateUnsignedShort_Min(unsignedShortObject.intValue(), diagnostics, context);
1368    if (result || diagnostics != null) result &= validateUnsignedShort_Max(unsignedShortObject.intValue(), diagnostics, context);
1369    return result;
1370  }
1371
1372} //XMLTypeValidator
1373
Popular Tags