case SimpleTypesFactory.LANGUAGE_TYPE: //-- Language
//-- since we don't actually support this type, yet, we'll simply treat
//-- it as a string, but warn the user.
LOG.warn("Warning: Currently, the W3C datatype '" + simpleType.getName()
+ "' is supported only as a String by Castor Source Generator.");
return new XSString();
case SimpleTypesFactory.LONG_TYPE: //-- long
XSLong xsLong = new XSLong(useWrapper);
if (!simpleType.isBuiltInType()) {
xsLong.setFacets(simpleType);
}
return xsLong;
case SimpleTypesFactory.NCNAME_TYPE: //--NCName
return new XSNCName();
case SimpleTypesFactory.NON_POSITIVE_INTEGER_TYPE: //-- nonPositiveInteger
XSNonPositiveInteger xsNPInteger = new XSNonPositiveInteger(useWrapper);
xsNPInteger.setFacets(simpleType);
return xsNPInteger;
case SimpleTypesFactory.NON_NEGATIVE_INTEGER_TYPE: //-- nonNegativeInteger
XSNonNegativeInteger xsNNInteger = new XSNonNegativeInteger(useWrapper);
xsNNInteger.setFacets(simpleType);
return xsNNInteger;
case SimpleTypesFactory.NEGATIVE_INTEGER_TYPE: //-- negative-integer
XSNegativeInteger xsNInteger = new XSNegativeInteger(useWrapper);
xsNInteger.setFacets(simpleType);
return xsNInteger;
case SimpleTypesFactory.UNSIGNED_INT_TYPE: //-- unsigned-integer
XSUnsignedInt xsUnsignedInt = new XSUnsignedInt(useWrapper);
xsUnsignedInt.setFacets(simpleType);
return xsUnsignedInt;
case SimpleTypesFactory.UNSIGNED_SHORT_TYPE: //-- unsigned-short
XSUnsignedShort xsUnsignedShort = new XSUnsignedShort(useWrapper);
xsUnsignedShort.setFacets(simpleType);
return xsUnsignedShort;
case SimpleTypesFactory.UNSIGNED_BYTE_TYPE: //-- unsigned-byte
XSUnsignedByte xsUnsignedByte = new XSUnsignedByte(useWrapper);
xsUnsignedByte.setFacets(simpleType);
return xsUnsignedByte;
case SimpleTypesFactory.UNSIGNED_LONG_TYPE: //-- unsigned-long
XSUnsignedLong xsUnsignedLong = new XSUnsignedLong();
xsUnsignedLong.setFacets(simpleType);
return xsUnsignedLong;
case SimpleTypesFactory.NORMALIZEDSTRING_TYPE: //-- normalizedString
XSNormalizedString xsNormalString = new XSNormalizedString();
if (!simpleType.isBuiltInType()) {
xsNormalString.setFacets(simpleType);
}
return xsNormalString;
case SimpleTypesFactory.POSITIVE_INTEGER_TYPE: //-- positive-integer
XSPositiveInteger xsPInteger = new XSPositiveInteger(useWrapper);
xsPInteger.setFacets(simpleType);
return xsPInteger;
case SimpleTypesFactory.QNAME_TYPE: //-- QName
XSQName xsQName = new XSQName();
xsQName.setFacets(simpleType);
return xsQName;
case SimpleTypesFactory.STRING_TYPE: //-- string
xsType = findXSTypeForEnumeration(simpleType, packageName, javaClassBindingName);
if (xsType == null) {
// Not an enumerated String type
XSString xsString = new XSString();
if (!simpleType.isBuiltInType()) {
xsString.setFacets(simpleType);
}
xsType = xsString;
}
break;
case SimpleTypesFactory.SHORT_TYPE: //-- short
XSShort xsShort = new XSShort(useWrapper);
if (!simpleType.isBuiltInType()) {
xsShort.setFacets(simpleType);
}
return xsShort;
case SimpleTypesFactory.TIME_TYPE: //-- time
XSTime xsTime = new XSTime();
if (!simpleType.isBuiltInType()) {
xsTime.setFacets(simpleType);
}
return xsTime;
case SimpleTypesFactory.TOKEN_TYPE: //-- token
//-- since we don't actually support this type, yet, we'll simply treat
//-- it as a string, but warn the user.
LOG.warn("Warning: Currently, the W3C datatype 'token'"
+ " is supported only as a String by Castor Source Generator.");
XSString xsString = new XSString();
if (!simpleType.isBuiltInType()) {
xsString.setFacets(simpleType);
}
return xsString;
default: //-- error
String name = simpleType.getName();
if (name == null || name.length() == 0) {