#foreach ($type in $types)
#set ($typeName = "${type.fullyQualifiedName}Type")
${type.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#if ($type.generalization)
#end
#if ($type.associationEnds)
#foreach ($associationEnd in $type.associationEnds)
#set ($otherEnd = $associationEnd.otherEnd)
#if ($otherEnd.navigable && ($otherEnd.type.isEnumeration()==false) && ($otherEnd.hasExactStereotype("AbstractAssociation") == false))
#if($otherEnd.composition && ($otherEnd.hasExactStereotype("MapAssocToElement") == true) )##For these cases, the association name is required in the schema
${otherEnd.association.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#elseif($otherEnd.composition && ($otherEnd.hasExactStereotype("MapAssocToElement") ==false) )##For these cases, the association name is not required in the schema
${otherEnd.association.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#elseif(($otherEnd.composition==false) && ($otherEnd.hasExactStereotype("MapAssocToElement") ==true) )##This is for cases, for example where there are parallel assocaitions to the same object, or the association name is needed to qualify the referenced object
${otherEnd.association.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#elseif(($otherEnd.composition==false) && $otherEnd.isMany()==true)##Treat otherEnd = many in the same way as
${otherEnd.association.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#end
#end
#end
##need to loop to create an element for class attributes not flagged with XmlAttribute
#foreach ($attribute in $type.attributes)
#if ($attribute.hasExactStereotype("XmlAttribute")==false)
#if($attribute.type.fullyQualifiedName == "string[]")
${attribute.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#else
${attribute.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#end
#end
#end
#end
#foreach ($attribute in $type.attributes)
#if(!($attribute.name == "id") && ($attribute.hasExactStereotype("XmlAttribute")==true))
#if($attribute.type.isEnumeration())
#if($attribute.required) ##use="require" is not correct...??
#else
#end
#set($enumValues = $attribute.type.getAttributes())
#foreach($enum in $enumValues)
#end
#else
#if($attribute.required)
#else
#end
${attribute.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#end
#end##end of if for attribute "id"
#end##end of for loop for all attributes
#foreach ($associationEnd in $type.associationEnds) ##Need to run this loop again to create an attribute for any association ends with one cardinality,
#set ($otherEnd = $associationEnd.otherEnd)
#if(($otherEnd.composition==false) && $otherEnd.isMany()==false && ($otherEnd.hasExactStereotype("AbstractAssociation") == false) && $otherEnd.navigable && ($otherEnd.hasExactStereotype("MapAssocToElement") == false))##This is for the case of a many end on the association end... in these cases we do the same as above...
#if($otherEnd.minOccurs == "1")##Note there is an error here... this is not working correctly...
#else
#end
${otherEnd.association.getDocumentation("").replaceAll("\n"," ").replaceAll("","").replaceAll("
","")}
#end
#end
#if ($type.generalization)
#end
#end
#foreach ($element in $types)
#set ($typeName = "${element.fullyQualifiedName}Type")
#if ($element.generalization)
#else
#end
#end