Author: knoaman
Date: Tue Dec  1 16:24:10 2009
New Revision: 885821

URL: http://svn.apache.org/viewvc?rev=885821&view=rev
Log:
Revert back to using short for facets to maintain backward compatibility

Modified:
    
xerces/java/branches/xml-schema-1.1-dev/samples/simpletype/SimpleTypeUsage.java
    xerces/java/branches/xml-schema-1.1-dev/samples/xni/PSVIWriter.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java
    
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java

Modified: 
xerces/java/branches/xml-schema-1.1-dev/samples/simpletype/SimpleTypeUsage.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/simpletype/SimpleTypeUsage.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/samples/simpletype/SimpleTypeUsage.java 
(original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/samples/simpletype/SimpleTypeUsage.java 
Tue Dec  1 16:24:10 2009
@@ -191,7 +191,7 @@
 
     // 'facets' property
     // gives bit combination of the constants defined in XSSimpleType 
interface.
-    int facets = simpleType.getDefinedFacets() ;
+    short facets = simpleType.getDefinedFacets() ;
     printFacets(facets);
 
     //'final' property
@@ -270,7 +270,7 @@
 
 }//printCardinality()
 
-void printFacets(int facets){
+void printFacets(short facets){
 
     System.err.println("'facets' present \t\t: " );
 

Modified: xerces/java/branches/xml-schema-1.1-dev/samples/xni/PSVIWriter.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/xni/PSVIWriter.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/samples/xni/PSVIWriter.java 
(original)
+++ xerces/java/branches/xml-schema-1.1-dev/samples/xni/PSVIWriter.java Tue Dec 
 1 16:24:10 2009
@@ -2118,7 +2118,7 @@
         }
     }
 
-    private String translateFacetKind(int kind) {
+    private String translateFacetKind(short kind) {
         switch (kind) {
             case XSSimpleTypeDefinition.FACET_WHITESPACE :
                 return SchemaSymbols.ELT_WHITESPACE;

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java
 Tue Dec  1 16:24:10 2009
@@ -263,8 +263,8 @@
     private short fVariety = -1;
     private short fValidationDV = -1;
 
-    private int fFacetsDefined = 0;
-    private int fFixedFacet = 0;
+    private short fFacetsDefined = 0;
+    private short fFixedFacet = 0;
 
     //for constraining facets
     private short fWhiteSpace = 0;
@@ -2161,7 +2161,7 @@
      * @param facetName  The name of the facet.
      * @return  True if the facet is defined, false otherwise.
      */
-    public boolean isDefinedFacet(int facetName) {
+    public boolean isDefinedFacet(short facetName) {
         if ((fFacetsDefined & facetName) != 0)
             return true;
         if (fPatternType != SPECIAL_PATTERN_NONE)
@@ -2175,11 +2175,11 @@
      * [facets]: all facets defined on this type. The value is a bit
      * combination of FACET_XXX constants of all defined facets.
      */
-    public int getDefinedFacets() {
+    public short getDefinedFacets() {
         if (fPatternType != SPECIAL_PATTERN_NONE)
-            return fFacetsDefined | FACET_PATTERN;
+            return (short)(fFacetsDefined | FACET_PATTERN);
         if (fValidationDV == DV_INTEGER)
-            return fFacetsDefined | FACET_PATTERN | FACET_FRACTIONDIGITS;
+            return (short)(fFacetsDefined | FACET_PATTERN | 
FACET_FRACTIONDIGITS);
         return fFacetsDefined;
     }
 
@@ -2189,7 +2189,7 @@
      * @param facetName  The name of the facet.
      * @return  True if the facet is fixed, false otherwise.
      */
-    public boolean isFixedFacet(int facetName) {
+    public boolean isFixedFacet(short facetName) {
         if ((fFixedFacet & facetName) != 0)
             return true;
         if (fValidationDV == DV_INTEGER)
@@ -2200,9 +2200,9 @@
     /**
      * [facets]: all defined facets for this type which are fixed.
      */
-    public int getFixedFacets() {
+    public short getFixedFacets() {
         if (fValidationDV == DV_INTEGER)
-            return fFixedFacet | FACET_FRACTIONDIGITS;
+            return (short)(fFixedFacet | FACET_FRACTIONDIGITS);
         return fFixedFacet;
     }
 
@@ -2218,7 +2218,7 @@
      * @return A value of the facet specified in <code>facetName</code> for
      *   this simple type definition or <code>null</code>.
      */
-    public String getLexicalFacetValue(int facetName) {
+    public String getLexicalFacetValue(short facetName) {
         switch (facetName) {
             case FACET_LENGTH:
                 return (fLength == -1)?null:Integer.toString(fLength);
@@ -3246,12 +3246,12 @@
     }
 
     private static final class XSFacetImpl implements XSFacet {
-        final int kind;
+        final short kind;
         final String value;
         final boolean fixed;
         final XSObjectList annotations;  
 
-        public XSFacetImpl(int kind, String value, boolean fixed, XSAnnotation 
annotation) {
+        public XSFacetImpl(short kind, String value, boolean fixed, 
XSAnnotation annotation) {
             this.kind = kind;
             this.value = value;
             this.fixed = fixed;
@@ -3292,7 +3292,7 @@
         /* (non-Javadoc)
          * @see org.apache.xerces.xs.XSFacet#getFacetKind()
          */
-        public int getFacetKind() {
+        public short getFacetKind() {
             return kind;
         }
 
@@ -3342,12 +3342,12 @@
     }
 
     private static final class XSMVFacetImpl implements XSMultiValueFacet {
-        final int kind;
+        final short kind;
         final XSObjectList annotations;
         final StringList values;
         final Vector asserts;
 
-        public XSMVFacetImpl(int kind, StringList values, XSObjectList 
annotations) {
+        public XSMVFacetImpl(short kind, StringList values, XSObjectList 
annotations) {
             this.kind = kind;
             this.values = values;
             this.annotations = (annotations != null) ? annotations : 
XSObjectListImpl.EMPTY_LIST;
@@ -3356,7 +3356,7 @@
         /*
          * overloaded constructor. added to support assertions.
          */
-        public XSMVFacetImpl(int kind, Vector asserts) {
+        public XSMVFacetImpl(short kind, Vector asserts) {
             this.kind = kind;
             this.asserts = asserts;
             this.values = null;
@@ -3366,7 +3366,7 @@
         /* (non-Javadoc)
          * @see org.apache.xerces.xs.XSFacet#getFacetKind()
          */
-        public int getFacetKind() {
+        public short getFacetKind() {
             return kind;
         }      
 

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/dv/xs/XSSimpleTypeDelegate.java
 Tue Dec  1 16:24:10 2009
@@ -61,7 +61,7 @@
         return type.getBuiltInKind();
     }
 
-    public int getDefinedFacets() {
+    public short getDefinedFacets() {
         return type.getDefinedFacets();
     }
 
@@ -73,7 +73,7 @@
         return type.getFinite();
     }
 
-    public int getFixedFacets() {
+    public short getFixedFacets() {
         return type.getFixedFacets();
     }
 
@@ -85,7 +85,7 @@
         return type.getLexicalEnumeration();
     }
 
-    public String getLexicalFacetValue(int facetName) {
+    public String getLexicalFacetValue(short facetName) {
         return type.getLexicalFacetValue(facetName);
     }
 
@@ -117,11 +117,11 @@
         return type.getVariety();
     }
 
-    public boolean isDefinedFacet(int facetName) {
+    public boolean isDefinedFacet(short facetName) {
         return type.isDefinedFacet(facetName);
     }
 
-    public boolean isFixedFacet(int facetName) {
+    public boolean isFixedFacet(short facetName) {
         return type.isFixedFacet(facetName);
     }
 

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java 
(original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSFacet.java 
Tue Dec  1 16:24:10 2009
@@ -26,7 +26,7 @@
      * The name of the facet, e.g. <code>FACET_LENGTH, FACET_TOTALDIGITS</code>
      *  (see <code>XSSimpleTypeDefinition</code>). 
      */
-    public int getFacetKind();
+    public short getFacetKind();
 
     /**
      * A value of this facet. 

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSMultiValueFacet.java
 Tue Dec  1 16:24:10 2009
@@ -27,7 +27,7 @@
      * The name of the facet, i.e. <code>FACET_ENUMERATION</code> and 
      * <code>FACET_PATTERN</code> (see <code>XSSimpleTypeDefinition</code>). 
      */
-    public int getFacetKind();
+    public short getFacetKind();
 
     /**
      * Values of this facet. 

Modified: 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java
URL: 
http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java?rev=885821&r1=885820&r2=885821&view=diff
==============================================================================
--- 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java
 (original)
+++ 
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/xs/XSSimpleTypeDefinition.java
 Tue Dec  1 16:24:10 2009
@@ -48,75 +48,75 @@
     /**
      * No facets defined.
      */
-    public static final int FACET_NONE                  = 0;
+    public static final short FACET_NONE                = 0;
     /**
      * 4.3.1 Length
      */
-    public static final int FACET_LENGTH                = 1;
+    public static final short FACET_LENGTH              = 1;
     /**
      * 4.3.2 minLength. 
      */
-    public static final int FACET_MINLENGTH             = 2;
+    public static final short FACET_MINLENGTH           = 2;
     /**
      * 4.3.3 maxLength.
      */
-    public static final int FACET_MAXLENGTH             = 4;
+    public static final short FACET_MAXLENGTH           = 4;
     /**
      * 4.3.4 pattern.
      */
-    public static final int FACET_PATTERN               = 8;
+    public static final short FACET_PATTERN             = 8;
     /**
      * 4.3.6 whitespace.
      */
-    public static final int FACET_WHITESPACE            = 16;
+    public static final short FACET_WHITESPACE          = 16;
     /**
      * 4.3.7 maxInclusive.
      */
-    public static final int FACET_MAXINCLUSIVE          = 32;
+    public static final short FACET_MAXINCLUSIVE        = 32;
     /**
      * 4.3.9 maxExclusive.
      */
-    public static final int FACET_MAXEXCLUSIVE          = 64;
+    public static final short FACET_MAXEXCLUSIVE        = 64;
     /**
      * 4.3.9 minExclusive.
      */
-    public static final int FACET_MINEXCLUSIVE          = 128;
+    public static final short FACET_MINEXCLUSIVE        = 128;
     /**
      * 4.3.10 minInclusive.
      */
-    public static final int FACET_MININCLUSIVE          = 256;
+    public static final short FACET_MININCLUSIVE        = 256;
     /**
      * 4.3.11 totalDigits .
      */
-    public static final int FACET_TOTALDIGITS           = 512;
+    public static final short FACET_TOTALDIGITS         = 512;
     /**
      * 4.3.12 fractionDigits.
      */
-    public static final int FACET_FRACTIONDIGITS        = 1024;
+    public static final short FACET_FRACTIONDIGITS      = 1024;
     /**
      * 4.3.5 enumeration.
      */
-    public static final int FACET_ENUMERATION           = 2048;
+    public static final short FACET_ENUMERATION         = 2048;
     
     /**
      * 4.3.13 maxScale (XML Schema 1.1)
      */
-    public static final int FACET_MAXSCALE              = 4096;         
+    public static final short FACET_MAXSCALE            = 4096;         
 
     /**
      * 4.3.14 minScale (XML Schema 1.1)
      */
-    public static final int FACET_MINSCALE              = 8192;
+    public static final short FACET_MINSCALE            = 8192;
 
     /**
      * 4.3.15 assert (XML Schema 1.1)
      */
-    public static final int FACET_ASSERT                = 16384;
+    public static final short FACET_ASSERT              = 16384;
 
     /**
      * 4.3.16 explicitTimeZone (XML Schema 1.1)
      */
-    public static final int FACET_EXPLICITTIMEZONE      = 32768;
+    public static final short FACET_EXPLICITTIMEZONE    = -32768;
 
     /**
      * A constant defined for the 'ordered' fundamental facet: not ordered.
@@ -168,7 +168,7 @@
      * [facets]: all facets defined on this type. The value is a bit 
      * combination of FACET_XXX constants of all defined facets. 
      */
-    public int getDefinedFacets();
+    public short getDefinedFacets();
 
     /**
      * Convenience method. [Facets]: check whether a facet is defined on this 
@@ -176,12 +176,12 @@
      * @param facetName  The name of the facet. 
      * @return  True if the facet is defined, false otherwise.
      */
-    public boolean isDefinedFacet(int facetName);
+    public boolean isDefinedFacet(short facetName);
 
     /**
      * [facets]: all defined facets for this type which are fixed.
      */
-    public int getFixedFacets();
+    public short getFixedFacets();
 
     /**
      * Convenience method. [Facets]: check whether a facet is defined and 
@@ -189,7 +189,7 @@
      * @param facetName  The name of the facet. 
      * @return  True if the facet is fixed, false otherwise.
      */
-    public boolean isFixedFacet(int facetName);
+    public boolean isFixedFacet(short facetName);
 
     /**
      * Convenience method. Returns a value of a single constraining facet for 
@@ -203,7 +203,7 @@
      * @return A value of the facet specified in <code>facetName</code> for 
      *   this simple type definition or <code>null</code>. 
      */
-    public String getLexicalFacetValue(int facetName);
+    public String getLexicalFacetValue(short facetName);
 
     /**
      * A list of enumeration values if it exists, otherwise an empty 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to