// If the value is a single valued type, we'll want the primitive type.
boolean shouldAddType = true;
anyAttributes = true;
AttributeDefinition ad = may.next();
TypeDefinition td = ad.getType();
if (ad.getGenericArgs() != null){
if (ad.getGenericArgs().equals("<DmcObjectName>"))
needDmwOmni = true;
}
switch(ad.getValueType()){
case SINGLE:
anySVAttributes = true;
break;
case HASHMAPPED:
case TREEMAPPED:
anyMVAttributes = true;
if (ad.getType().getIsRefType())
anyMVRefs = true;
iterables.put(td.getName(),td);
break;
case MULTI:
case HASHSET:
case TREESET:
anyMVAttributes = true;
if (ad.getType().getIsRefType())
anyMVRefs = true;
iterables.put(td.getName(),td);
break;
}
if (shouldAddType){
types.put(td.getName(), td);
TypeAndAttr ta = new TypeAndAttr(td,ad.getValueType(),ad.getIndexSize());
typeAndAttr.put(ta.name, ta);
}
appendAttributeInfo(attributeInfo, ad.getName().getNameString(), ad.getDmdID(), ad.getType().getName().getNameString(), ad.getValueType(), ad.getDataType());
if (ad.getGenericArgsImport() != null)
genericImports.add(ad.getGenericArgsImport());
if (ad.getValueType() != ValueTypeEnum.SINGLE){
addImport(uniqueImports, longestImport, ad.getDefinedIn().getDMSASGImport(), "Attribute from " + ad.getDefinedIn().getName() + " schema");
}
allAttr.add(ad);
}
}
Iterator<AttributeDefinition> must = cd.getMust();
if (must != null){
while(must.hasNext()){
// NOTE: COMPLICATED! We always add the type of the attribute to our global types
// map EXCEPT IF the type is a non-referential, MULTI/SET attribute. Gaa!
//
// This is because WE DON'T want the primitive type any more, just the TYPEIterableDMW.
// If the value is a single valued type, we'll want the primitive type.
boolean shouldAddType = true;
anyAttributes = true;
AttributeDefinition ad = must.next();
TypeDefinition td = ad.getType();
if (ad.getGenericArgs() != null){
if (ad.getGenericArgs().equals("<DmcObjectName>"))
needDmwOmni = true;
}
switch(ad.getValueType()){
case SINGLE:
anySVAttributes = true;
break;
case HASHMAPPED:
case TREEMAPPED:
anyMVAttributes = true;
if (ad.getType().getIsRefType())
anyMVRefs = true;
iterables.put(td.getName(),td);
break;
case MULTI:
case HASHSET:
case TREESET:
anyMVAttributes = true;
if (ad.getType().getIsRefType())
anyMVRefs = true;
iterables.put(td.getName(),td);
break;
}
if (shouldAddType){
types.put(td.getName(), td);
TypeAndAttr ta = new TypeAndAttr(td,ad.getValueType(),ad.getIndexSize());
typeAndAttr.put(ta.name, ta);
}
appendAttributeInfo(attributeInfo, ad.getName().getNameString(), ad.getDmdID(), ad.getType().getName().getNameString(), ad.getValueType(), ad.getDataType());
if (ad.getGenericArgsImport() != null)
genericImports.add(ad.getGenericArgsImport());
if (ad.getValueType() != ValueTypeEnum.SINGLE){
addImport(uniqueImports, longestImport, ad.getDefinedIn().getDMSASGImport(), "Attribute from " + ad.getDefinedIn().getName() + " schema");
}
allAttr.add(ad);
}
}
if (cd.getIsNamedBy() != null){
AttributeDefinition isNamedBy = cd.getIsNamedBy();
String nameAttributeType = isNamedBy.getType().getPrimitiveType();
addImport(uniqueImports, longestImport, nameAttributeType, "Is named by");
}
if (useWrappedObjectRefs)