use of eu.esdihumboldt.hale.io.xsd.reader.internal.XmlAttributeGroupReferenceProperty in project hale by halestudio.
the class XmlSchemaReader method createAttributesFromCollection.
private void createAttributesFromCollection(XmlSchemaObjectCollection attributeCollection, DefinitionGroup declaringType, String indexPrefix, String schemaLocation, String schemaNamespace) {
if (indexPrefix == null) {
// $NON-NLS-1$
indexPrefix = "";
}
for (int index = 0; index < attributeCollection.getCount(); index++) {
XmlSchemaObject object = attributeCollection.getItem(index);
if (object instanceof XmlSchemaAttribute) {
// <attribute ... />
XmlSchemaAttribute attribute = (XmlSchemaAttribute) object;
createAttribute(attribute, declaringType, schemaLocation, schemaNamespace);
} else if (object instanceof XmlSchemaAttributeGroup) {
XmlSchemaAttributeGroup group = (XmlSchemaAttributeGroup) object;
createAttributes(group, declaringType, indexPrefix + index, schemaLocation, schemaNamespace);
} else if (object instanceof XmlSchemaAttributeGroupRef) {
XmlSchemaAttributeGroupRef groupRef = (XmlSchemaAttributeGroupRef) object;
if (groupRef.getRefName() != null) {
QName groupName = groupRef.getRefName();
// XXX extend group name with namespace?
XmlAttributeGroupReferenceProperty property = new XmlAttributeGroupReferenceProperty(groupName, declaringType, this.index, groupName, true);
// TODO add constraints?
// set metadata
setMetadata(property, groupRef, schemaLocation);
} else {
reporter.error(new IOMessageImpl("Unrecognized attribute group reference", null, object.getLineNumber(), object.getLinePosition()));
}
}
}
}
Aggregations