You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by bi...@apache.org on 2011/04/23 19:08:45 UTC

svn commit: r1096179 - /webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java

Author: bimargulies
Date: Sat Apr 23 17:08:45 2011
New Revision: 1096179

URL: http://svn.apache.org/viewvc?rev=1096179&view=rev
Log:
undo mistaken commit

Modified:
    webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java

Modified: webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java
URL: http://svn.apache.org/viewvc/webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java?rev=1096179&r1=1096178&r2=1096179&view=diff
==============================================================================
--- webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java (original)
+++ webservices/xmlschema/tags/xmlschema-2.0/xmlschema-core/src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java Sat Apr 23 17:08:45 2011
@@ -345,9 +345,6 @@ public final class XmlSchemaCollection {
         addSimpleType(xsd, Constants.XSD_LANGUAGE.getLocalPart());
         addSimpleType(xsd, Constants.XSD_TOKEN.getLocalPart());
 
-        // 2.5.3 setup built-in datatype hierarchy 
-        setupBuiltinDatatypeHierarchy(xsd);
-
         // SchemaKey key = new SchemaKey(XmlSchema.SCHEMA_NS, null);
         // addSchema(key, xsd);
 
@@ -371,77 +368,6 @@ public final class XmlSchemaCollection {
         }
     }
 
-    private void setupBuiltinDatatypeHierarchy(XmlSchema xsd) {
-
-        setDerivationByRestriction(xsd, Constants.XSD_ANYSIMPLETYPE, Constants.XSD_ANYTYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DURATION, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DATETIME, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_TIME, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DATE, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_YEARMONTH, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_YEAR, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_MONTHDAY, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DAY, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_MONTH, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_BOOLEAN, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_BASE64, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_HEXBIN, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_FLOAT, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DOUBLE, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_ANYURI, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_QNAME, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_NOTATION, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_NOTATION, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_DECIMAL, Constants.XSD_ANYSIMPLETYPE);
-
-        setDerivationByRestriction(xsd, Constants.XSD_INTEGER, Constants.XSD_DECIMAL);
-        setDerivationByRestriction(xsd, Constants.XSD_NONPOSITIVEINTEGER, Constants.XSD_INTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_NEGATIVEINTEGER, Constants.XSD_NONPOSITIVEINTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_LONG, Constants.XSD_INTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_INT, Constants.XSD_LONG);
-        setDerivationByRestriction(xsd, Constants.XSD_SHORT, Constants.XSD_INT);
-        setDerivationByRestriction(xsd, Constants.XSD_BYTE, Constants.XSD_SHORT);
-        setDerivationByRestriction(xsd, Constants.XSD_NONNEGATIVEINTEGER, Constants.XSD_INTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_POSITIVEINTEGER, Constants.XSD_NONNEGATIVEINTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_UNSIGNEDLONG, Constants.XSD_NONNEGATIVEINTEGER);
-        setDerivationByRestriction(xsd, Constants.XSD_UNSIGNEDINT, Constants.XSD_UNSIGNEDLONG);
-        setDerivationByRestriction(xsd, Constants.XSD_UNSIGNEDSHORT, Constants.XSD_UNSIGNEDINT);
-        setDerivationByRestriction(xsd, Constants.XSD_UNSIGNEDBYTE, Constants.XSD_UNSIGNEDSHORT);
-
-        setDerivationByRestriction(xsd, Constants.XSD_STRING, Constants.XSD_ANYSIMPLETYPE);
-        setDerivationByRestriction(xsd, Constants.XSD_NORMALIZEDSTRING, Constants.XSD_STRING);
-        setDerivationByRestriction(xsd, Constants.XSD_TOKEN, Constants.XSD_NORMALIZEDSTRING);
-        setDerivationByRestriction(xsd, Constants.XSD_LANGUAGE, Constants.XSD_TOKEN);
-        setDerivationByRestriction(xsd, Constants.XSD_NMTOKEN, Constants.XSD_TOKEN);
-        setDerivationByRestriction(xsd, Constants.XSD_NAME, Constants.XSD_NMTOKEN);
-        setDerivationByRestriction(xsd, Constants.XSD_NCNAME, Constants.XSD_TOKEN);
-        setDerivationByRestriction(xsd, Constants.XSD_ID, Constants.XSD_NCNAME);
-        setDerivationByRestriction(xsd, Constants.XSD_IDREF, Constants.XSD_NCNAME);
-        setDerivationByRestriction(xsd, Constants.XSD_ENTITY, Constants.XSD_NCNAME);
-
-        setDerivationByList(xsd, Constants.XSD_NMTOKENS, Constants.XSD_NMTOKEN);
-        setDerivationByList(xsd, Constants.XSD_IDREFS, Constants.XSD_IDREF);
-        setDerivationByList(xsd, Constants.XSD_ENTITIES, Constants.XSD_ENTITY);
-    }
-
-    private void setDerivationByRestriction(XmlSchema xsd, QName child, QName parent) {
-
-        XmlSchemaSimpleType simple = (XmlSchemaSimpleType)xsd.getTypeByName(child);
-        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
-        restriction.setBaseTypeName(parent);
-        restriction.setBaseType((XmlSchemaSimpleType)xsd.getTypeByName(parent));
-        simple.setContent(restriction);
-    }
-
-    private void setDerivationByList(XmlSchema xsd, QName child, QName parent) {
-
-        XmlSchemaSimpleType simple = (XmlSchemaSimpleType)xsd.getTypeByName(child);
-        XmlSchemaSimpleTypeList restriction = new XmlSchemaSimpleTypeList();
-        restriction.setItemTypeName(parent);
-        restriction.setItemType((XmlSchemaSimpleType)xsd.getTypeByName(parent));
-        simple.setContent(restriction);
-    }
-
     /**
      * Pop the stack of schemas. This function, while public, is probably not useful outside of the
      * implementation.