TYPE_DEF_STACK.set(new Stack<String>());
}
if (type != null) {
if (TYPE_DEF_STACK.get().contains(type.getQualifiedName())) {
parent.addContent(new Comment("..."));
}
else if (type instanceof EnumTypeDefinition) {
parent.addContent(new org.jdom.Text("..."));
}
else {
XmlType baseType = type.getBaseType();
if (baseType instanceof XmlClassType) {
TypeDefinition typeDef = ((XmlClassType) baseType).getTypeDefinition();
if (typeDef != null) {
generateExampleXml(typeDef, parent, defaultNs, maxDepth);
}
}
TYPE_DEF_STACK.get().push(type.getQualifiedName());
for (Attribute attribute : type.getAttributes()) {
generateExampleXml(attribute, parent, defaultNs);
}
if (type.getValue() != null) {
generateExampleXml(type.getValue(), parent);
}
else {
for (Element element : type.getElements()) {
generateExampleXml(element, parent, defaultNs, maxDepth);
}
}
TYPE_DEF_STACK.get().pop();
}
}
else {
parent.addContent(new Comment("..."));
}
}