private CorbaTypeImpl processSimpleRestrictionType(XmlSchemaSimpleType stype,
QName name, QName schematypeName,
boolean anonymous)
throws Exception {
CorbaTypeImpl corbaTypeImpl = null;
// checks if enumeration
XmlSchemaSimpleTypeRestriction restrictionType = (XmlSchemaSimpleTypeRestriction)stype
.getContent();
QName baseName = checkPrefix(restrictionType.getBaseTypeName());
String maxLength = null;
String length = null;
Iterator i = restrictionType.getFacets().getIterator();
while (i.hasNext()) {
XmlSchemaFacet val = (XmlSchemaFacet)i.next();
if (val instanceof XmlSchemaMaxLengthFacet) {
maxLength = val.getValue().toString();
}
if (val instanceof XmlSchemaLengthFacet) {
length = val.getValue().toString();
}
}
if (isEnumeration(restrictionType)) {
corbaTypeImpl = createCorbaEnum(restrictionType, name, schematypeName);
} else {
if (restrictionType.getBaseType() != null) {
corbaTypeImpl = convertSchemaToCorbaType(restrictionType.getBaseType(), schematypeName,
stype, false);
} else {
corbaTypeImpl = processPrimitiveType(baseName);
if (corbaTypeImpl == null) {
XmlSchemaType schematype = findSchemaType(baseName);
corbaTypeImpl = convertSchemaToCorbaType(schematype, schematypeName,
schematype, false);
}
}
if (corbaTypeImpl != null) {
if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_STRING)
|| (baseName.equals(W3CConstants.NT_SCHEMA_STRING))) {
corbaTypeImpl =
wsdltypes.processStringType(corbaTypeImpl, name, maxLength, length);
} else if (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_DECIMAL)
|| (baseName.equals(W3CConstants.NT_SCHEMA_DECIMAL))) {
corbaTypeImpl = wsdltypes.processDecimalType(restrictionType, name,
corbaTypeImpl, anonymous);
} else if ((corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_BASE64))
|| (baseName.equals(W3CConstants.NT_SCHEMA_BASE64))
|| (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))
|| (corbaTypeImpl.getType().equals(W3CConstants.NT_SCHEMA_HBIN))) {
corbaTypeImpl = wsdltypes.processBase64Type(corbaTypeImpl,
name, maxLength, length);
}
}
}