in src/main/java/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java [2027:2141]
private XmlObject createBuiltinSubclass(SchemaType sType) {
boolean complex = !sType.isSimpleType();
switch (getBuiltinTypeCode()) {
case BTC_NOT_BUILTIN:
return new XmlAnyTypeImpl(BuiltinSchemaTypeSystem.ST_NO_TYPE);
case BTC_ANY_TYPE:
case BTC_ANY_SIMPLE:
switch (sType.getSimpleVariety()) {
case NOT_SIMPLE:
return new XmlComplexContentImpl(sType);
case ATOMIC:
return new XmlAnySimpleTypeRestriction(sType, complex);
case LIST:
return new XmlListImpl(sType, complex);
case UNION:
return new XmlUnionImpl(sType, complex);
default:
throw new IllegalStateException();
}
case BTC_BOOLEAN:
return new XmlBooleanRestriction(sType, complex);
case BTC_BASE_64_BINARY:
return new XmlBase64BinaryRestriction(sType, complex);
case BTC_HEX_BINARY:
return new XmlHexBinaryRestriction(sType, complex);
case BTC_ANY_URI:
return new XmlAnyUriRestriction(sType, complex);
case BTC_QNAME:
return new XmlQNameRestriction(sType, complex);
case BTC_NOTATION:
return new XmlNotationRestriction(sType, complex);
case BTC_FLOAT:
return new XmlFloatRestriction(sType, complex);
case BTC_DOUBLE:
return new XmlDoubleRestriction(sType, complex);
case BTC_DECIMAL:
return new XmlDecimalRestriction(sType, complex);
case BTC_STRING:
if (sType.hasStringEnumValues()) {
return new XmlStringEnumeration(sType, complex);
} else {
return new XmlStringRestriction(sType, complex);
}
case BTC_DURATION:
return new XmlDurationImpl(sType, complex);
case BTC_DATE_TIME:
return new XmlDateTimeImpl(sType, complex);
case BTC_TIME:
return new XmlTimeImpl(sType, complex);
case BTC_DATE:
return new XmlDateImpl(sType, complex);
case BTC_G_YEAR_MONTH:
return new XmlGYearMonthImpl(sType, complex);
case BTC_G_YEAR:
return new XmlGYearImpl(sType, complex);
case BTC_G_MONTH_DAY:
return new XmlGMonthDayImpl(sType, complex);
case BTC_G_DAY:
return new XmlGDayImpl(sType, complex);
case BTC_G_MONTH:
return new XmlGMonthImpl(sType, complex);
case BTC_INTEGER:
return new XmlIntegerRestriction(sType, complex);
case BTC_LONG:
return new XmlLongRestriction(sType, complex);
case BTC_INT:
return new XmlIntRestriction(sType, complex);
case BTC_SHORT:
return new XmlShortImpl(sType, complex);
case BTC_BYTE:
return new XmlByteImpl(sType, complex);
case BTC_NON_POSITIVE_INTEGER:
return new XmlNonPositiveIntegerImpl(sType, complex);
case BTC_NEGATIVE_INTEGER:
return new XmlNegativeIntegerImpl(sType, complex);
case BTC_NON_NEGATIVE_INTEGER:
return new XmlNonNegativeIntegerImpl(sType, complex);
case BTC_POSITIVE_INTEGER:
return new XmlPositiveIntegerImpl(sType, complex);
case BTC_UNSIGNED_LONG:
return new XmlUnsignedLongImpl(sType, complex);
case BTC_UNSIGNED_INT:
return new XmlUnsignedIntImpl(sType, complex);
case BTC_UNSIGNED_SHORT:
return new XmlUnsignedShortImpl(sType, complex);
case BTC_UNSIGNED_BYTE:
return new XmlUnsignedByteImpl(sType, complex);
case BTC_NORMALIZED_STRING:
return new XmlNormalizedStringImpl(sType, complex);
case BTC_TOKEN:
return new XmlTokenImpl(sType, complex);
case BTC_NAME:
return new XmlNameImpl(sType, complex);
case BTC_NCNAME:
return new XmlNCNameImpl(sType, complex);
case BTC_LANGUAGE:
return new XmlLanguageImpl(sType, complex);
case BTC_ID:
return new XmlIdImpl(sType, complex);
case BTC_IDREF:
return new XmlIdRefImpl(sType, complex);
case BTC_IDREFS:
return new XmlIdRefsImpl(sType, complex);
case BTC_ENTITY:
return new XmlEntityImpl(sType, complex);
case BTC_ENTITIES:
return new XmlEntitiesImpl(sType, complex);
case BTC_NMTOKEN:
return new XmlNmTokenImpl(sType, complex);
case BTC_NMTOKENS:
return new XmlNmTokensImpl(sType, complex);
default:
throw new IllegalStateException("Unrecognized builtin type: " + getBuiltinTypeCode());
}
}