add(typeDef.getSchema());
String namespace = typeDef.getNamespace();
String prefix = addNamespace(namespace);
SchemaInfo schemaInfo = namespacesToSchemas.get(namespace);
if (schemaInfo == null) {
schemaInfo = new SchemaInfo();
schemaInfo.setId(prefix);
schemaInfo.setNamespace(namespace);
namespacesToSchemas.put(namespace, schemaInfo);
}
schemaInfo.getTypeDefinitions().add(typeDef);
REFERENCE_STACK.get().addFirst("\"see also\" annotation");
addSeeAlsoTypeDefinitions(typeDef);
REFERENCE_STACK.get().removeFirst();
for (Element element : typeDef.getElements()) {
if (includeReferencedClasses()) {
REFERENCE_STACK.get().addFirst("accessor " + element.getSimpleName() + " of type definition " + typeDef.getQualifiedName());
addReferencedTypeDefinitions(element);
REFERENCE_STACK.get().removeFirst();
}
ImplicitSchemaElement implicitElement = getImplicitElement(element);
if (implicitElement != null) {
String implicitElementNamespace = element.isWrapped() ? element.getWrapperNamespace() : element.getNamespace();
SchemaInfo referencedSchemaInfo = namespacesToSchemas.get(implicitElementNamespace);
if (referencedSchemaInfo == null) {
referencedSchemaInfo = new SchemaInfo();
referencedSchemaInfo.setId(addNamespace(implicitElementNamespace));
referencedSchemaInfo.setNamespace(implicitElementNamespace);
namespacesToSchemas.put(implicitElementNamespace, referencedSchemaInfo);
}
referencedSchemaInfo.getImplicitSchemaElements().add(implicitElement);
}
}
for (Attribute attribute : typeDef.getAttributes()) {
if (includeReferencedClasses()) {
REFERENCE_STACK.get().addFirst("accessor " + attribute.getSimpleName() + " of type definition " + typeDef.getQualifiedName());
addReferencedTypeDefinitions(attribute);
REFERENCE_STACK.get().removeFirst();
}
ImplicitSchemaAttribute implicitAttribute = getImplicitAttribute(attribute);
if (implicitAttribute != null) {
String implicitAttributeNamespace = attribute.getNamespace();
SchemaInfo referencedSchemaInfo = namespacesToSchemas.get(implicitAttributeNamespace);
if (referencedSchemaInfo == null) {
referencedSchemaInfo = new SchemaInfo();
referencedSchemaInfo.setId(addNamespace(implicitAttributeNamespace));
referencedSchemaInfo.setNamespace(implicitAttributeNamespace);
namespacesToSchemas.put(implicitAttributeNamespace, referencedSchemaInfo);
}
referencedSchemaInfo.getImplicitSchemaAttributes().add(implicitAttribute);
}
}
if (typeDef.getAnyAttributeQNameEnumRef() != null) {
REFERENCE_STACK.get().addFirst("qname enum ref on @XmlAnyAttribute of type definition " + typeDef.getQualifiedName());