if (!cType.getDescriptors().isEmpty()) {
stringBuffer.append(TEXT_18);
for (Iterator adItr = cType.getDescriptors().iterator(); adItr.hasNext();) {
PropertyDescriptor pd = (PropertyDescriptor) adItr.next();
if ( !(pd instanceof AttributeDescriptor) ) {
continue;
}
AttributeDescriptor ad = (AttributeDescriptor) pd;
AttributeType adType = ad.getType();
String adTypeName = adType.getName().getLocalPart().toUpperCase() +
"_TYPE";
String adTypeURI = adType.getName().getNamespaceURI();
if (!uri.equals(adTypeURI)) {
adTypeName = ns2import.get(adTypeURI) + "." + adTypeName;
}
String adName = "new NameImpl(\"" + ad.getName().getNamespaceURI() +
"\",\"" + ad.getName().getLocalPart() + "\")";
String min = ad.getMinOccurs() + "";
String max = ad.getMaxOccurs() + "";
String isNillable = ad.isNillable() ? "true" : "false";
stringBuffer.append(TEXT_19);
stringBuffer.append(TEXT_20);
stringBuffer.append(adTypeName);
stringBuffer.append(TEXT_21);
stringBuffer.append(adName);
stringBuffer.append(TEXT_22);
stringBuffer.append(min);
stringBuffer.append(TEXT_23);
stringBuffer.append(max);
stringBuffer.append(TEXT_24);
stringBuffer.append(isNillable);
stringBuffer.append(TEXT_25);
}
stringBuffer.append(TEXT_26);
stringBuffer.append(uri);
stringBuffer.append(TEXT_27);
stringBuffer.append(local);
stringBuffer.append(TEXT_28);
stringBuffer.append(isIdentified);
stringBuffer.append(TEXT_29);
stringBuffer.append(TEXT_30);
stringBuffer.append(isAbstract);
stringBuffer.append(TEXT_31);
stringBuffer.append(restrictions);
stringBuffer.append(TEXT_32);
stringBuffer.append(superType);
stringBuffer.append(TEXT_33);
stringBuffer.append(description);
stringBuffer.append(TEXT_34);
}
else {
stringBuffer.append(TEXT_35);
stringBuffer.append(uri);
stringBuffer.append(TEXT_36);
stringBuffer.append(local);
stringBuffer.append(TEXT_37);
stringBuffer.append(isIdentified);
stringBuffer.append(TEXT_38);
stringBuffer.append(TEXT_39);
stringBuffer.append(isAbstract);
stringBuffer.append(TEXT_40);
stringBuffer.append(restrictions);
stringBuffer.append(TEXT_41);
stringBuffer.append(superType);
stringBuffer.append(TEXT_42);
stringBuffer.append(description);
stringBuffer.append(TEXT_43);
}
}
else {
stringBuffer.append(TEXT_44);
stringBuffer.append(uri);
stringBuffer.append(TEXT_45);
stringBuffer.append(local);
stringBuffer.append(TEXT_46);
stringBuffer.append(binding);
stringBuffer.append(TEXT_47);
stringBuffer.append(isIdentified);
stringBuffer.append(TEXT_48);
stringBuffer.append(TEXT_49);
stringBuffer.append(isAbstract);
stringBuffer.append(TEXT_50);
stringBuffer.append(restrictions);
stringBuffer.append(TEXT_51);
stringBuffer.append(superType);
stringBuffer.append(TEXT_52);
stringBuffer.append(description);
stringBuffer.append(TEXT_53);
}
if (!type.getUserData().isEmpty()) {
//attributes
for (Iterator i = type.getUserData().entrySet().iterator(); i.hasNext(); ) {
Map.Entry entry = (Map.Entry) i.next();
Name n = (Name) entry.getKey();
PropertyDescriptor pd = (PropertyDescriptor) entry.getValue();
PropertyType pdType = pd.getType();
String pdTypeName = pdType.getName().getLocalPart().toUpperCase() +
"_TYPE";
if (ns2import.containsKey(pdType.getName().getNamespaceURI())) {
String importClassName = (String) ns2import.get(pdType.getName().getNamespaceURI());
pdTypeName = importClassName + "." + pdTypeName;
}
String pdName = "new NameImpl(\"" + pd.getName().getNamespaceURI() +
"\",\"" + pd.getName().getLocalPart() + "\")";
stringBuffer.append(TEXT_54);
stringBuffer.append(pdName);
stringBuffer.append(TEXT_55);