GME
13
|
00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 /* 00019 * $Id: DecimalDatatypeValidator.cpp 932887 2010-04-11 13:04:59Z borisk $ 00020 */ 00021 00022 // --------------------------------------------------------------------------- 00023 // Includes 00024 // --------------------------------------------------------------------------- 00025 #include <xercesc/validators/datatype/DecimalDatatypeValidator.hpp> 00026 #include <xercesc/validators/datatype/XMLCanRepGroup.hpp> 00027 #include <xercesc/validators/schema/SchemaSymbols.hpp> 00028 #include <xercesc/validators/datatype/InvalidDatatypeFacetException.hpp> 00029 #include <xercesc/validators/datatype/InvalidDatatypeValueException.hpp> 00030 00031 #include <xercesc/validators/datatype/DatatypeValidatorFactory.hpp> 00032 #include <xercesc/util/NumberFormatException.hpp> 00033 #include <xercesc/util/XMLBigDecimal.hpp> 00034 #include <xercesc/util/XMLBigInteger.hpp> 00035 00036 XERCES_CPP_NAMESPACE_BEGIN 00037 00038 static const int BUF_LEN = 64; 00039 00040 // --------------------------------------------------------------------------- 00041 // Constructors and Destructor 00042 // --------------------------------------------------------------------------- 00043 DecimalDatatypeValidator::DecimalDatatypeValidator(MemoryManager* const manager) 00044 :AbstractNumericValidator(0, 0, 0, DatatypeValidator::Decimal, manager) 00045 , fTotalDigits(0) 00046 , fFractionDigits(0) 00047 { 00048 setOrdered(XSSimpleTypeDefinition::ORDERED_TOTAL); 00049 setNumeric(true); 00050 } 00051 00052 DecimalDatatypeValidator::DecimalDatatypeValidator( 00053 DatatypeValidator* const baseValidator 00054 , RefHashTableOf<KVStringPair>* const facets 00055 , RefArrayVectorOf<XMLCh>* const enums 00056 , const int finalSet 00057 , MemoryManager* const manager) 00058 :AbstractNumericValidator(baseValidator, facets, finalSet, DatatypeValidator::Decimal, manager) 00059 , fTotalDigits(0) 00060 , fFractionDigits(0) 00061 { 00062 init(enums, manager); 00063 } 00064 00065 DecimalDatatypeValidator::~DecimalDatatypeValidator() 00066 { 00067 } 00068 00069 // ----------------------------------------------------------------------- 00070 // Compare methods 00071 // ----------------------------------------------------------------------- 00072 int DecimalDatatypeValidator::compare(const XMLCh* const lValue 00073 , const XMLCh* const rValue 00074 , MemoryManager* const manager) 00075 { 00076 XMLBigDecimal lObj(lValue, manager); 00077 XMLBigDecimal rObj(rValue, manager); 00078 00079 return compareValues(&lObj, &rObj); 00080 } 00081 00082 DatatypeValidator* DecimalDatatypeValidator::newInstance 00083 ( 00084 RefHashTableOf<KVStringPair>* const facets 00085 , RefArrayVectorOf<XMLCh>* const enums 00086 , const int finalSet 00087 , MemoryManager* const manager 00088 ) 00089 { 00090 return (DatatypeValidator*) new (manager) DecimalDatatypeValidator(this, facets, enums, finalSet, manager); 00091 } 00092 00093 // ----------------------------------------------------------------------- 00094 // ctor provided to be used by derived classes 00095 // ----------------------------------------------------------------------- 00096 DecimalDatatypeValidator::DecimalDatatypeValidator(DatatypeValidator* const baseValidator 00097 , RefHashTableOf<KVStringPair>* const facets 00098 , const int finalSet 00099 , const ValidatorType type 00100 , MemoryManager* const manager) 00101 :AbstractNumericValidator(baseValidator, facets, finalSet, type, manager) 00102 , fTotalDigits(0) 00103 , fFractionDigits(0) 00104 { 00105 //do not invoke init here !!! 00106 } 00107 00108 void DecimalDatatypeValidator::assignAdditionalFacet(const XMLCh* const key 00109 , const XMLCh* const value 00110 , MemoryManager* const manager) 00111 { 00112 if (XMLString::equals(key, SchemaSymbols::fgELT_TOTALDIGITS)) 00113 { 00114 int val; 00115 try 00116 { 00117 val = XMLString::parseInt(value, manager); 00118 } 00119 catch (NumberFormatException&) 00120 { 00121 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_TotalDigit, value, manager); 00122 } 00123 00124 // check 4.3.11.c0 must: totalDigits > 0 00125 if ( val <= 0 ) 00126 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_PosInt_TotalDigit, value, manager); 00127 00128 setTotalDigits(val); 00129 setFacetsDefined(DatatypeValidator::FACET_TOTALDIGITS); 00130 } 00131 else if (XMLString::equals(key, SchemaSymbols::fgELT_FRACTIONDIGITS)) 00132 { 00133 int val; 00134 try 00135 { 00136 val = XMLString::parseInt(value, manager); 00137 } 00138 catch (NumberFormatException&) 00139 { 00140 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_Invalid_FractDigit, value, manager); 00141 } 00142 00143 // check 4.3.12.c0 must: fractionDigits > 0 00144 if ( val < 0 ) 00145 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException, XMLExcepts::FACET_NonNeg_FractDigit, value, manager); 00146 00147 setFractionDigits(val); 00148 setFacetsDefined(DatatypeValidator::FACET_FRACTIONDIGITS); 00149 } 00150 else 00151 { 00152 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException 00153 , XMLExcepts::FACET_Invalid_Tag 00154 , key 00155 , manager); 00156 } 00157 } 00158 00159 void DecimalDatatypeValidator::inheritAdditionalFacet() 00160 { 00161 00162 DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); 00163 00164 if (!numBase) 00165 return; 00166 00167 int thisFacetsDefined = getFacetsDefined(); 00168 int baseFacetsDefined = numBase->getFacetsDefined(); 00169 00170 // inherit totalDigits 00171 if ((( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && 00172 (( thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) == 0) ) 00173 { 00174 setTotalDigits(numBase->fTotalDigits); 00175 setFacetsDefined(DatatypeValidator::FACET_TOTALDIGITS); 00176 } 00177 00178 // inherit fractionDigits 00179 if ((( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && 00180 (( thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) == 0) ) 00181 { 00182 setFractionDigits(numBase->fFractionDigits); 00183 setFacetsDefined(DatatypeValidator::FACET_FRACTIONDIGITS); 00184 } 00185 } 00186 00187 void DecimalDatatypeValidator::checkAdditionalFacetConstraints(MemoryManager* const manager) const 00188 { 00189 int thisFacetsDefined = getFacetsDefined(); 00190 00191 // check 4.3.12.c1 must: fractionDigits <= totalDigits 00192 if ( ((thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && 00193 ((thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) ) 00194 { 00195 if ( fFractionDigits > fTotalDigits ) 00196 { 00197 XMLCh value1[BUF_LEN+1]; 00198 XMLCh value2[BUF_LEN+1]; 00199 XMLString::binToText(getFractionDigits(), value1, BUF_LEN, 10, manager); 00200 XMLString::binToText(getTotalDigits(), value2, BUF_LEN, 10, manager); 00201 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00202 , XMLExcepts::FACET_TotDigit_FractDigit 00203 , value2 00204 , value1 00205 , manager); 00206 } 00207 } 00208 00209 } 00210 00211 void DecimalDatatypeValidator::checkAdditionalFacetConstraintsBase(MemoryManager* const manager) const 00212 { 00213 00214 DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); 00215 00216 if (!numBase) 00217 return; 00218 00219 int thisFacetsDefined = getFacetsDefined(); 00220 int baseFacetsDefined = numBase->getFacetsDefined(); 00221 00222 // check 4.3.11.c1 error: totalDigits > base.totalDigits 00223 // totalDigits != base.totalDigits if (base.fixed) 00224 if (( thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) 00225 { 00226 if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && 00227 ( fTotalDigits > numBase->fTotalDigits )) 00228 { 00229 XMLCh value1[BUF_LEN+1]; 00230 XMLCh value2[BUF_LEN+1]; 00231 XMLString::binToText(fTotalDigits, value1, BUF_LEN, 10, manager); 00232 XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); 00233 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00234 , XMLExcepts::FACET_totalDigit_base_totalDigit 00235 , value1 00236 , value2 00237 , manager); 00238 } 00239 00240 if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && 00241 (( numBase->getFixed() & DatatypeValidator::FACET_TOTALDIGITS) != 0) && 00242 ( fTotalDigits != numBase->fTotalDigits )) 00243 { 00244 XMLCh value1[BUF_LEN+1]; 00245 XMLCh value2[BUF_LEN+1]; 00246 XMLString::binToText(fTotalDigits, value1, BUF_LEN, 10, manager); 00247 XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); 00248 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00249 , XMLExcepts::FACET_totalDigit_base_fixed 00250 , value1 00251 , value2 00252 , manager); 00253 } 00254 } 00255 00256 if (( thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) 00257 { 00258 // check question error: fractionDigits > base.fractionDigits ??? 00259 if ( (( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && 00260 ( fFractionDigits > numBase->fFractionDigits )) 00261 { 00262 XMLCh value1[BUF_LEN+1]; 00263 XMLCh value2[BUF_LEN+1]; 00264 XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); 00265 XMLString::binToText(numBase->fFractionDigits, value2, BUF_LEN, 10, manager); 00266 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00267 , XMLExcepts::FACET_fractDigit_base_fractDigit 00268 , value1 00269 , value2 00270 , manager); 00271 } 00272 00273 // check question error: fractionDigits > base.totalDigits ??? 00274 if ( (( baseFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0) && 00275 ( fFractionDigits > numBase->fTotalDigits )) 00276 { 00277 XMLCh value1[BUF_LEN+1]; 00278 XMLCh value2[BUF_LEN+1]; 00279 XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); 00280 XMLString::binToText(numBase->fTotalDigits, value2, BUF_LEN, 10, manager); 00281 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00282 , XMLExcepts::FACET_fractDigit_base_totalDigit 00283 , value1 00284 , value2 00285 , manager); 00286 } 00287 00288 // fractionDigits != base.fractionDigits if (base.fixed) 00289 if ( (( baseFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && 00290 (( numBase->getFixed() & DatatypeValidator::FACET_FRACTIONDIGITS) != 0) && 00291 ( fFractionDigits != numBase->fFractionDigits )) 00292 { 00293 XMLCh value1[BUF_LEN+1]; 00294 XMLCh value2[BUF_LEN+1]; 00295 XMLString::binToText(fFractionDigits, value1, BUF_LEN, 10, manager); 00296 XMLString::binToText(numBase->fFractionDigits, value2, BUF_LEN, 10, manager); 00297 ThrowXMLwithMemMgr2(InvalidDatatypeFacetException 00298 , XMLExcepts::FACET_fractDigit_base_fixed 00299 , value1 00300 , value2 00301 , manager); 00302 } 00303 } 00304 00305 } 00306 00307 int DecimalDatatypeValidator::compareValues(const XMLNumber* const lValue 00308 , const XMLNumber* const rValue) 00309 { 00310 return XMLBigDecimal::compareValues((XMLBigDecimal*) lValue, (XMLBigDecimal*) rValue, 00311 ((XMLBigDecimal*)lValue)->getMemoryManager()); 00312 } 00313 00314 void DecimalDatatypeValidator::setMaxInclusive(const XMLCh* const value) 00315 { 00316 fMaxInclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); 00317 } 00318 00319 void DecimalDatatypeValidator::setMaxExclusive(const XMLCh* const value) 00320 { 00321 fMaxExclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); 00322 } 00323 00324 void DecimalDatatypeValidator::setMinInclusive(const XMLCh* const value) 00325 { 00326 fMinInclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); 00327 } 00328 00329 void DecimalDatatypeValidator::setMinExclusive(const XMLCh* const value) 00330 { 00331 fMinExclusive = new (fMemoryManager) XMLBigDecimal(value, fMemoryManager); 00332 } 00333 00334 void DecimalDatatypeValidator::setEnumeration(MemoryManager* const manager) 00335 { 00336 // check 4.3.5.c0 must: enumeration values from the value space of base 00337 // 00338 // 1. shall be from base value space 00339 // 2. shall be from current value space as well ( shall go through boundsCheck() ) 00340 // 00341 if (!fStrEnumeration) 00342 return; 00343 00344 XMLSize_t i = 0; 00345 XMLSize_t enumLength = fStrEnumeration->size(); 00346 00347 DecimalDatatypeValidator *numBase = (DecimalDatatypeValidator*) getBaseValidator(); 00348 if (numBase) 00349 { 00350 try 00351 { 00352 for ( i = 0; i < enumLength; i++) 00353 { 00354 numBase->checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); 00355 } 00356 } 00357 catch (XMLException&) 00358 { 00359 ThrowXMLwithMemMgr1(InvalidDatatypeFacetException 00360 , XMLExcepts::FACET_enum_base 00361 , fStrEnumeration->elementAt(i) 00362 , manager); 00363 } 00364 } 00365 #if 0 00366 // spec says that only base has to checkContent 00367 // We put the this->checkContent in a separate loop 00368 // to not block original message with in that method. 00369 // 00370 for ( i = 0; i < enumLength; i++) 00371 { 00372 checkContent(fStrEnumeration->elementAt(i), (ValidationContext*)0, false, manager); 00373 } 00374 #endif 00375 fEnumeration = new (manager) RefVectorOf<XMLNumber>(enumLength, true, manager); 00376 fEnumerationInherited = false; 00377 00378 for ( i = 0; i < enumLength; i++) 00379 { 00380 fEnumeration->insertElementAt(new (manager) XMLBigDecimal(fStrEnumeration->elementAt(i), manager), i); 00381 } 00382 00383 } 00384 00385 // ----------------------------------------------------------------------- 00386 // Abstract interface from AbstractNumericValidator 00387 // ----------------------------------------------------------------------- 00388 void DecimalDatatypeValidator::checkContent(const XMLCh* const content 00389 , ValidationContext* const context 00390 , bool asBase 00391 , MemoryManager* const manager) 00392 { 00393 //validate against base validator if any 00394 DecimalDatatypeValidator *pBase = (DecimalDatatypeValidator*) this->getBaseValidator(); 00395 if (pBase) 00396 pBase->checkContent(content, context, true, manager); 00397 00398 int thisFacetsDefined = getFacetsDefined(); 00399 00400 // we check pattern first 00401 if ( (thisFacetsDefined & DatatypeValidator::FACET_PATTERN ) != 0 ) 00402 { 00403 if (getRegex()->matches(content, manager) ==false) 00404 { 00405 ThrowXMLwithMemMgr2(InvalidDatatypeValueException 00406 , XMLExcepts::VALUE_NotMatch_Pattern 00407 , content 00408 , getPattern() 00409 , manager); 00410 } 00411 } 00412 00413 // if this is a base validator, we only need to check pattern facet 00414 // all other facet were inherited by the derived type 00415 if (asBase) 00416 return; 00417 00418 XMLBigDecimal compareDataValue(content, manager); 00419 XMLBigDecimal* compareData = &compareDataValue; 00420 00421 if (getEnumeration()) 00422 { 00423 XMLSize_t i=0; 00424 XMLSize_t enumLength = getEnumeration()->size(); 00425 for ( ; i < enumLength; i++) 00426 { 00427 if (compareValues(compareData, (XMLBigDecimal*) getEnumeration()->elementAt(i)) ==0 ) 00428 break; 00429 } 00430 00431 if (i == enumLength) 00432 ThrowXMLwithMemMgr1(InvalidDatatypeValueException, XMLExcepts::VALUE_NotIn_Enumeration, content, manager); 00433 } 00434 00435 boundsCheck(compareData, manager); 00436 00437 if ( (thisFacetsDefined & DatatypeValidator::FACET_FRACTIONDIGITS) != 0 ) 00438 { 00439 if ( compareData->getScale() > fFractionDigits ) 00440 { 00441 XMLCh value1[BUF_LEN+1]; 00442 XMLCh value2[BUF_LEN+1]; 00443 XMLString::binToText(compareData->getScale(), value1, BUF_LEN, 10, manager); 00444 XMLString::binToText(fFractionDigits, value2, BUF_LEN, 10, manager); 00445 ThrowXMLwithMemMgr3(InvalidDatatypeFacetException 00446 , XMLExcepts::VALUE_exceed_fractDigit 00447 , compareData->getRawData() 00448 , value1 00449 , value2 00450 , manager); 00451 } 00452 } 00453 00454 if ( (thisFacetsDefined & DatatypeValidator::FACET_TOTALDIGITS) != 0 ) 00455 { 00456 if ( compareData->getTotalDigit() > fTotalDigits ) 00457 { 00458 XMLCh value1[BUF_LEN+1]; 00459 XMLCh value2[BUF_LEN+1]; 00460 XMLString::binToText(compareData->getTotalDigit(), value1, BUF_LEN, 10, manager); 00461 XMLString::binToText(fTotalDigits, value2, BUF_LEN, 10, manager); 00462 ThrowXMLwithMemMgr3(InvalidDatatypeFacetException 00463 , XMLExcepts::VALUE_exceed_totalDigit 00464 , compareData->getRawData() 00465 , value1 00466 , value2 00467 , manager); 00468 } 00469 00470 /*** 00471 E2-44 totalDigits 00472 ... by restricting it to numbers that are expressible as i x 10^-n 00473 where i and n are integers such that |i| < 10^totalDigits and 0 <= n <= totalDigits. 00474 ***/ 00475 00476 if ( compareData->getScale() > fTotalDigits ) 00477 { 00478 XMLCh value1[BUF_LEN+1]; 00479 XMLCh value2[BUF_LEN+1]; 00480 XMLString::binToText(compareData->getScale(), value1, BUF_LEN, 10, manager); 00481 XMLString::binToText(fTotalDigits, value2, BUF_LEN, 10, manager); 00482 ThrowXMLwithMemMgr3(InvalidDatatypeFacetException 00483 , XMLExcepts::VALUE_exceed_totalDigit 00484 , compareData->getRawData() 00485 , value1 00486 , value2 00487 , manager); 00488 } 00489 } 00490 } 00491 00492 /*** 00493 * 3.2.3 decimal 00494 * 00495 * . the preceding optional "+" sign is prohibited. 00496 * . The decimal point is required. 00497 * . Leading and trailing zeroes are prohibited subject to the following: 00498 * there must be at least one digit to the right and to the left of the decimal point which may be a zero. 00499 * 00500 * 00501 * 3.3.13 integer 00502 * 3.3.16 long 00503 * 3.3.17 int 00504 * 3.3.18 short 00505 * 3.3.19 byte 00506 * 3.3.20 nonNegativeInteger 00507 * 3.3.25 positiveInteger 00508 * 00509 * . the preceding optional "+" sign is prohibited and 00510 * . leading zeroes are prohibited. 00511 * 00512 * 00513 * E2-27 00514 * 3.3.14 nonPositiveInteger 00515 * 00516 * . In the canonical form for zero, the sign must be omitted. 00517 * . leading zeroes are prohibited. 00518 * 00519 * 3.3.15 negativeInteger 00520 * 3.3.21 unsignedLong 00521 * 3.3.22 unsignedInt 00522 * 3.3.23 unsignedShort 00523 * 3.3.24 unsignedByte 00524 * 00525 * . leading zeroes are prohibited. 00526 * 00527 * Summary: 00528 * . leading zeros are prohibited for all three groups 00529 * . '-' is required for nonPositiveInteger if it is zero 00530 * 00531 ***/ 00532 00533 const XMLCh* DecimalDatatypeValidator::getCanonicalRepresentation(const XMLCh* const rawData 00534 , MemoryManager* const memMgr 00535 , bool toValidate) const 00536 { 00537 MemoryManager* toUse = memMgr? memMgr : fMemoryManager; 00538 DecimalDatatypeValidator* temp = (DecimalDatatypeValidator*) this; 00539 00540 if (toValidate) 00541 { 00542 try 00543 { 00544 temp->checkContent(rawData, 0, false, toUse); 00545 } 00546 catch (...) 00547 { 00548 return 0; 00549 } 00550 } 00551 00552 // XMLBigInteger::getCanonicalRepresentation and 00553 // XMLBigDecimal::getCanonicalRepresentation will handle exceptional cases 00554 XMLCanRepGroup::CanRepGroup dvType = DatatypeValidatorFactory::getCanRepGroup(temp); 00555 00556 if ((dvType == XMLCanRepGroup::Decimal_Derived_signed) || 00557 (dvType == XMLCanRepGroup::Decimal_Derived_unsigned) || 00558 (dvType == XMLCanRepGroup::Decimal_Derived_npi) ) 00559 { 00560 return XMLBigInteger::getCanonicalRepresentation(rawData, toUse, dvType == XMLCanRepGroup::Decimal_Derived_npi); 00561 } 00562 else if (dvType == XMLCanRepGroup::Decimal) 00563 { 00564 return XMLBigDecimal::getCanonicalRepresentation(rawData, toUse); 00565 } 00566 else //in case? 00567 { 00568 return XMLString::replicate(rawData, toUse); 00569 } 00570 00571 } 00572 00573 /*** 00574 * Support for Serialization/De-serialization 00575 ***/ 00576 00577 IMPL_XSERIALIZABLE_TOCREATE(DecimalDatatypeValidator) 00578 00579 void DecimalDatatypeValidator::serialize(XSerializeEngine& serEng) 00580 { 00581 /*** 00582 * Note: 00583 * 00584 * During storing, we need write the specific number 00585 * type info before calling base::serialize(). 00586 * 00587 * While loading, we do nothing here 00588 ***/ 00589 00590 if (serEng.isStoring()) 00591 { 00592 serEng<<(int) (XMLNumber::BigDecimal); 00593 } 00594 00595 AbstractNumericValidator::serialize(serEng); 00596 00597 //don't serialize XMLBigDecimal* 00598 if (serEng.isStoring()) 00599 { 00600 serEng<<fTotalDigits; 00601 serEng<<fFractionDigits; 00602 } 00603 else 00604 { 00605 serEng>>fTotalDigits; 00606 serEng>>fFractionDigits; 00607 } 00608 00609 } 00610 00611 XERCES_CPP_NAMESPACE_END 00612