You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/06/08 22:55:24 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/validators/datatype DecimalDatatypeValidator.java DatatypeMessageProvider.java

sandygao    01/06/08 13:55:23

  Modified:    java/src/org/apache/xerces/validators/datatype
                        DecimalDatatypeValidator.java
                        DatatypeMessageProvider.java
  Log:
  no message
  
  Revision  Changes    Path
  1.26      +13 -12    xml-xerces/java/src/org/apache/xerces/validators/datatype/DecimalDatatypeValidator.java
  
  Index: DecimalDatatypeValidator.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/DecimalDatatypeValidator.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- DecimalDatatypeValidator.java	2001/05/15 16:32:38	1.25
  +++ DecimalDatatypeValidator.java	2001/06/08 20:55:22	1.26
  @@ -73,7 +73,7 @@
    * @author Ted Leung
    * @author Jeffrey Rodriguez
    * @author Mark Swinkles - List Validation refactoring
  - * @version $Id: DecimalDatatypeValidator.java,v 1.25 2001/05/15 16:32:38 elena Exp $
  + * @version $Id: DecimalDatatypeValidator.java,v 1.26 2001/06/08 20:55:22 sandygao Exp $
    */
   
   public class DecimalDatatypeValidator extends AbstractNumericValidator {
  @@ -106,15 +106,15 @@
       }
   
       protected void inheritAdditionalFacets() {
  -        
  +
           // inherit totalDigits
  -        if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS) != 0) && 
  +        if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS) != 0) &&
                !((fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS) != 0) ) {
               fFacetsDefined |= FACET_TOTALDIGITS;
               fTotalDigits = ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits;
           }
           // inherit fractionDigits
  -        if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0) 
  +        if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0)
                && !((fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0) ) {
               fFacetsDefined |= FACET_FRACTIONDIGITS;
               fFractionDigits = ((DecimalDatatypeValidator)fBaseValidator).fFractionDigits;
  @@ -123,7 +123,7 @@
   
       protected void checkFacetConstraints() throws InvalidDatatypeFacetException{
           // check 4.3.12.c1 must: fractionDigits <= totalDigits
  -        if ( ((fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0) && 
  +        if ( ((fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0) &&
                ((fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS) != 0) ) {
               if ( fFractionDigits > fTotalDigits )
                   throw new InvalidDatatypeFacetException( "fractionDigits value ='" + this.fFractionDigits + "'must be <= totalDigits value ='" +
  @@ -138,12 +138,12 @@
               if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS) != 0)){
                   if ((((DecimalDatatypeValidator)fBaseValidator).fFlags & DatatypeValidator.FACET_TOTALDIGITS) != 0 &&
                        fTotalDigits != ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits){
  -                    throw new InvalidDatatypeFacetException("totalDigits value = '" + fTotalDigits + 
  +                    throw new InvalidDatatypeFacetException("totalDigits value = '" + fTotalDigits +
                                                               "' must be equal to base.totalDigits value = '" +
  -                                                            ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits + 
  +                                                            ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits +
                                                               "' with attribute {fixed} = true" );
                   }
  -                if (fTotalDigits > ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits ){                
  +                if (fTotalDigits > ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits ){
                       throw new InvalidDatatypeFacetException( "totalDigits value ='" + fTotalDigits + "' must be <= base.totalDigits value ='" +
                                                            ((DecimalDatatypeValidator)fBaseValidator).fTotalDigits + "'." );
                   }
  @@ -154,16 +154,16 @@
               if ( (( ((DecimalDatatypeValidator)fBaseValidator).fFacetsDefined & DatatypeValidator.FACET_FRACTIONDIGITS) != 0)){
                   if ((((DecimalDatatypeValidator)fBaseValidator).fFlags & DatatypeValidator.FACET_FRACTIONDIGITS) != 0 &&
                        fFractionDigits != ((DecimalDatatypeValidator)fBaseValidator).fFractionDigits){
  -                    throw new InvalidDatatypeFacetException("fractionDigits value = '" + fFractionDigits + 
  +                    throw new InvalidDatatypeFacetException("fractionDigits value = '" + fFractionDigits +
                                                               "' must be equal to base.fractionDigits value = '" +
  -                                                            ((DecimalDatatypeValidator)fBaseValidator).fFractionDigits + 
  +                                                            ((DecimalDatatypeValidator)fBaseValidator).fFractionDigits +
                                                               "' with attribute {fixed} = true" );
                   }
               }
           }
       }
   
  -    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{        
  +    protected void assignAdditionalFacets(String key,  Hashtable facets ) throws InvalidDatatypeFacetException{
   
           String value = null;
           try {
  @@ -301,7 +301,8 @@
                   throw new InvalidDatatypeValueException(
                                                          getErrorString(DatatypeMessageProvider.FRACTION_EXCEEDED,
                                                                         DatatypeMessageProvider.MSG_NONE,
  -                                                                      new Object[] { content}));
  +                                                                      new Object[] { "'" + content + "'" + " with fractionDigits = '"+ d.scale() +"'"
  +                                                                          , "'" + fFractionDigits + "'"}));
           }
           if ( (fFacetsDefined & DatatypeValidator.FACET_TOTALDIGITS)!=0 ) {
               int totalDigits = d.movePointRight(d.scale()).toString().length() -
  
  
  
  1.9       +21 -21    xml-xerces/java/src/org/apache/xerces/validators/datatype/DatatypeMessageProvider.java
  
  Index: DatatypeMessageProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/datatype/DatatypeMessageProvider.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DatatypeMessageProvider.java	2001/04/25 20:41:55	1.8
  +++ DatatypeMessageProvider.java	2001/06/08 20:55:23	1.9
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights 
  + * Copyright (c) 1999, 2000 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -10,7 +10,7 @@
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer. 
  + *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
  @@ -18,7 +18,7 @@
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:  
  + *    if any, must include the following acknowledgment:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowledgment may appear in the software itself,
  @@ -26,7 +26,7 @@
    *
    * 4. The names "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    software without prior written permission. For written
    *    permission, please contact apache@apache.org.
    *
    * 5. Products derived from this software may not be called "Apache",
  @@ -63,9 +63,9 @@
   import org.apache.xerces.utils.XMLMessageProvider;
   
   /**
  - * 
  + *
    * @author Jeffrey Rodriguez
  - * @version $Id: DatatypeMessageProvider.java,v 1.8 2001/04/25 20:41:55 elena Exp $
  + * @version $Id: DatatypeMessageProvider.java,v 1.9 2001/06/08 20:55:23 sandygao Exp $
    */
   public class DatatypeMessageProvider implements XMLMessageProvider {
       /**
  @@ -138,7 +138,7 @@
       // Major Codes
       //
       private static int counter = 0;
  -    public static final int 
  +    public static final int
       MSG_BAD_MAJORCODE  = counter++,              //  majorCode parameter to createMessage was out of bounds
       MSG_FORMAT_FAILURE = counter++,             //  exception thrown during messageFormat call
       NOT_BOOLEAN        = counter++,
  @@ -175,20 +175,20 @@
       MSG_NONE = 0;
   
       public static final String[] fgMessageKeys = {
  -        "BadMajorCode",                 
  -        "FormatFailed",                 
  -        "NotBoolean",                           
  -        "NotDecimal",                   
  -        "NotFloat",                     
  -        "NotDouble",                     
  -        "InvalidEnumValue",            
  -        "OutOfBounds",                  
  -        "NotAnEnumValue",               
  -        "FractionDigitsLargerThanTotalDigits",     
  -        "TotalDigitsExceeded",            
  -        "FractionDigitsExceeded",                
  -        "IllegalFacetValue",            
  -        "IllegalAnyURIFacet",           
  +        "BadMajorCode",
  +        "FormatFailed",
  +        "NotBoolean",
  +        "NotDecimal",
  +        "NotFloat",
  +        "NotDouble",
  +        "InvalidEnumValue",
  +        "OutOfBounds",
  +        "NotAnEnumValue",
  +        "FractionDigitsLargerThanTotalDigits",
  +        "FractionDigitsExceeded",
  +        "TotalDigitsExceeded",
  +        "IllegalFacetValue",
  +        "IllegalAnyURIFacet",
           "IllegalBooleanFacet",
           "IllegalBase64Facet",
           "IllegalDateTimeFacet",
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org