throw new SerializerException(
"wrong context: obj needs to be of type Class, but is: "
+ obj.getClass().getName());
}
SerializerRegistry reg = SerializerRegistry.getInstance();
ComponentSerializer ser = reg.getSerializer(type);
output.startDocument();
output.startElement("xsd:schema");
AttrImpl attr = new AttrImpl();
attr.addAttribute("name", ser.getXMLTypeName());
attr.addAttribute("type", ser.getXMLTypeName());
attr.addAttribute("nillable", "true");
output.startElement("xsd:element", attr);
output.endElement("xsd:element");
// get and document all used classes
_dependendClasses.add(type);
Set usedClasses = new HashSet();
Iterator it = _dependendClasses.iterator();
while (it.hasNext()) {
Class aClass = (Class) it.next();
ser = reg.getSerializer(aClass);
ser.addUsedClasses(aClass, usedClasses);
}
documentUsedClasses(usedClasses, output);