use of com.predic8.membrane.annot.model.ElementInfo in project service-proxy by membrane.
the class Schemas method assembleElementInfo.
private void assembleElementInfo(Writer w, Model m, MainInfo main, ElementInfo i) throws IOException {
w.append("<xsd:sequence>\r\n");
for (ChildElementInfo cei : i.getCeis()) {
w.append("<xsd:choice" + (cei.isRequired() ? " minOccurs=\"1\"" : " minOccurs=\"0\"") + (cei.isList() ? " maxOccurs=\"unbounded\"" : "") + ">\r\n");
assembleDocumentation(w, i);
for (ElementInfo ei : main.getChildElementDeclarations().get(cei.getTypeDeclaration()).getElementInfo()) {
if (ei.getAnnotation().topLevel())
w.append("<xsd:element ref=\"" + ei.getAnnotation().name() + "\">\r\n");
else
w.append("<xsd:element name=\"" + ei.getAnnotation().name() + "\" type=\"" + ei.getXSDTypeName(m) + "\">\r\n");
assembleDocumentation(w, ei);
w.append("</xsd:element>\r\n");
}
if (cei.getAnnotation().allowForeign())
w.append("<xsd:any namespace=\"##other\" processContents=\"strict\" />\r\n");
w.append("</xsd:choice>\r\n");
}
w.append("</xsd:sequence>\r\n");
for (AttributeInfo ai : i.getAis()) if (!ai.getXMLName().equals("id"))
assembleAttributeDeclaration(w, ai);
if (i.getOai() != null) {
w.append("<xsd:anyAttribute processContents=\"skip\">\r\n");
assembleDocumentation(w, i.getOai());
w.append("</xsd:anyAttribute>\r\n");
}
}
Aggregations