SchemaCollection schemaCollection,
NamespacePrefixAccumulator prefixAccumulator,
AttributeInfo attributeInfo) {
if (annotated instanceof XmlSchemaAttribute) {
XmlSchemaAttribute attribute = (XmlSchemaAttribute)annotated;
String attributeNamespaceURI = attribute.getQName().getNamespaceURI();
boolean attributeNoNamespace = "".equals(attributeNamespaceURI);
XmlSchema attributeSchema = null;
if (!attributeNoNamespace) {
attributeSchema = schemaCollection.getSchemaByTargetNamespace(attributeNamespaceURI);
if (attributeSchema == null) {
throw new RuntimeException("Missing schema " + attributeNamespaceURI);
}
}
boolean qualified = !attributeNoNamespace
&& XmlSchemaUtils.isAttributeQualified(attribute, true, currentSchema,
attributeSchema);
attributeInfo.xmlName = prefixAccumulator.xmlAttributeString(attribute, qualified);
// we are assuming here that we are not dealing, in close proximity,
// with elements with identical local names and different
// namespaces.
attributeInfo.javascriptName = attribute.getQName().getLocalPart();
attributeInfo.defaultValue = attribute.getDefaultValue();
attributeInfo.fixedValue = attribute.getFixedValue();
attributeInfo.use = attribute.getUse();
factorySetupType(attribute, schemaCollection, attributeInfo);
} else { // any
attributeInfo.any = true;
attributeInfo.xmlName = null; // unknown until runtime.
attributeInfo.javascriptName = "any";