in src/main/java/org/apache/ws/commons/schema/XmlSchemaCollection.java [270:369]
public void init() {
stack = new Stack<SchemaKey>();
unresolvedTypes = new HashMap<QName, List<TypeReceiver>>();
extReg = new ExtensionRegistry();
knownNamespaceMap = new HashMap<String, XmlSchema>();
schemaResolver = new DefaultURIResolver();
schemas = new HashMap<SchemaKey, XmlSchema>();
// LAST, since the ctor for XmlSchema will reach back into here.
xsd = new XmlSchema(XmlSchema.SCHEMA_NS, this);
/*
* Defined in section 4.
*/
addSimpleType(xsd, Constants.XSD_ANYSIMPLETYPE.getLocalPart());
addSimpleType(xsd, Constants.XSD_ANYTYPE.getLocalPart());
/*
* Primitive types 3.2.1 string 3.2.2 boolean 3.2.3 decimal 3.2.4 float 3.2.5 double 3.2.6 duration
* 3.2.7 dateTime 3.2.8 time 3.2.9 date 3.2.10 gYearMonth 3.2.11 gYear 3.2.12 gMonthDay 3.2.13 gDay
* 3.2.14 gMonth 3.2.15 hexBinary 3.2.16 base64Binary 3.2.17 anyURI 3.2.18 QName 3.2.19 NOTATION
*/
addSimpleType(xsd, Constants.XSD_STRING.getLocalPart());
addSimpleType(xsd, Constants.XSD_BOOLEAN.getLocalPart());
addSimpleType(xsd, Constants.XSD_FLOAT.getLocalPart());
addSimpleType(xsd, Constants.XSD_DOUBLE.getLocalPart());
addSimpleType(xsd, Constants.XSD_QNAME.getLocalPart());
addSimpleType(xsd, Constants.XSD_DECIMAL.getLocalPart());
addSimpleType(xsd, Constants.XSD_DURATION.getLocalPart());
addSimpleType(xsd, Constants.XSD_DATE.getLocalPart());
addSimpleType(xsd, Constants.XSD_TIME.getLocalPart());
addSimpleType(xsd, Constants.XSD_DATETIME.getLocalPart());
addSimpleType(xsd, Constants.XSD_DAY.getLocalPart());
addSimpleType(xsd, Constants.XSD_MONTH.getLocalPart());
addSimpleType(xsd, Constants.XSD_MONTHDAY.getLocalPart());
addSimpleType(xsd, Constants.XSD_YEAR.getLocalPart());
addSimpleType(xsd, Constants.XSD_YEARMONTH.getLocalPart());
addSimpleType(xsd, Constants.XSD_NOTATION.getLocalPart());
addSimpleType(xsd, Constants.XSD_HEXBIN.getLocalPart());
addSimpleType(xsd, Constants.XSD_BASE64.getLocalPart());
addSimpleType(xsd, Constants.XSD_ANYURI.getLocalPart());
/*
* 3.3.1 normalizedString 3.3.2 token 3.3.3 language 3.3.4 NMTOKEN 3.3.5 NMTOKENS 3.3.6 Name 3.3.7
* NCName 3.3.8 ID 3.3.9 IDREF 3.3.10 IDREFS 3.3.11 ENTITY 3.3.12 ENTITIES 3.3.13 integer 3.3.14
* nonPositiveInteger 3.3.15 negativeInteger 3.3.16 long 3.3.17 int 3.3.18 short 3.3.19 byte 3.3.20
* nonNegativeInteger 3.3.21 unsignedLong 3.3.22 unsignedInt 3.3.23 unsignedShort 3.3.24 unsignedByte
* 3.3.25 positiveInteger
*/
// derived types from decimal
addSimpleType(xsd, Constants.XSD_LONG.getLocalPart());
addSimpleType(xsd, Constants.XSD_SHORT.getLocalPart());
addSimpleType(xsd, Constants.XSD_BYTE.getLocalPart());
addSimpleType(xsd, Constants.XSD_INTEGER.getLocalPart());
addSimpleType(xsd, Constants.XSD_INT.getLocalPart());
addSimpleType(xsd, Constants.XSD_POSITIVEINTEGER.getLocalPart());
addSimpleType(xsd, Constants.XSD_NEGATIVEINTEGER.getLocalPart());
addSimpleType(xsd, Constants.XSD_NONPOSITIVEINTEGER.getLocalPart());
addSimpleType(xsd, Constants.XSD_NONNEGATIVEINTEGER.getLocalPart());
addSimpleType(xsd, Constants.XSD_UNSIGNEDBYTE.getLocalPart());
addSimpleType(xsd, Constants.XSD_UNSIGNEDINT.getLocalPart());
addSimpleType(xsd, Constants.XSD_UNSIGNEDLONG.getLocalPart());
addSimpleType(xsd, Constants.XSD_UNSIGNEDSHORT.getLocalPart());
// derived types from string
addSimpleType(xsd, Constants.XSD_NAME.getLocalPart());
addSimpleType(xsd, Constants.XSD_NORMALIZEDSTRING.getLocalPart());
addSimpleType(xsd, Constants.XSD_NCNAME.getLocalPart());
addSimpleType(xsd, Constants.XSD_NMTOKEN.getLocalPart());
addSimpleType(xsd, Constants.XSD_NMTOKENS.getLocalPart());
addSimpleType(xsd, Constants.XSD_ENTITY.getLocalPart());
addSimpleType(xsd, Constants.XSD_ENTITIES.getLocalPart());
addSimpleType(xsd, Constants.XSD_ID.getLocalPart());
addSimpleType(xsd, Constants.XSD_IDREF.getLocalPart());
addSimpleType(xsd, Constants.XSD_IDREFS.getLocalPart());
addSimpleType(xsd, Constants.XSD_LANGUAGE.getLocalPart());
addSimpleType(xsd, Constants.XSD_TOKEN.getLocalPart());
// SchemaKey key = new SchemaKey(XmlSchema.SCHEMA_NS, null);
// addSchema(key, xsd);
// look for a system property to see whether we have a registered
// extension registry class. if so we'll instantiate a new one
// and set it as the extension registry
// if there is an error, we'll just print out a message and move on.
if (System.getProperty(Constants.SystemConstants.EXTENSION_REGISTRY_KEY) != null) {
try {
Class clazz = Class.forName(System
.getProperty(Constants.SystemConstants.EXTENSION_REGISTRY_KEY));
this.extReg = (ExtensionRegistry)clazz.newInstance();
} catch (ClassNotFoundException e) {
System.err.println("The specified extension registry class cannot be found!");
} catch (InstantiationException e) {
System.err.println("The specified extension registry class cannot be instantiated!");
} catch (IllegalAccessException e) {
System.err.println("The specified extension registry class cannot be accessed!");
}
}
}