term((XSObject)currentComponents.get(i), XSConstants.MODEL_GROUP, step.getNametest(), result);
}
break;
case Axis.ANY_ATTRIBUTE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = ((XSObject)currentComponents.get(i));
short type = comp.getType();
if (type == XSConstants.TYPE_DEFINITION) {
type = ((XSTypeDefinition)comp).getTypeCategory();
if (type == XSTypeDefinition.COMPLEX_TYPE) {
addComponent(((XSComplexTypeDefinition)comp).getAttributeWildcard(),
step.getNametest(), result);
}
} else if (type == XSConstants.ATTRIBUTE_GROUP) {
addComponent(((XSAttributeGroupDefinition)comp).getAttributeWildcard(),
step.getNametest(), result);
}
}
break;
case Axis.ANY:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
term((XSObject)currentComponents.get(i), XSConstants.WILDCARD, step.getNametest(), result);
}
break;
case Axis.FACET: // we are returning the part of thefacets. a limitation
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
componentLinked((XSObject)currentComponents.get(i), XSConstants.FACET, step.getNametest(), result);
}
break;
case Axis.SCOPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
componentScope((XSObject)currentComponents.get(i), result);
}
break;
case Axis.CONTEXT:
// TODO: we do not support this yet. is Schema 1.1
throw new SCDException("Error in SCD: Context axis is not supported");
//break;
case Axis.SUBSTITUTION_GROUP:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = (XSObject)currentComponents.get(i);
if (comp.getType() == XSConstants.ELEMENT_DECLARATION) {
addComponent(((XSElementDeclaration)comp).getSubstitutionGroupAffiliation(),
step.getNametest(), result);
}
}
break;
case Axis.BASE_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
addComponent((((XSTypeDefinition)currentComponents.get(i))).getBaseType(),
step.getNametest(), result);
}
}
break;
case Axis.ITEM_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
XSObject comp = (XSObject)currentComponents.get(i);
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
addComponent(((XSSimpleTypeDefinition)comp).getItemType(),
step.getNametest(), result);
}
}
}
break;
case Axis.MEMBER_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
XSObject comp = (XSObject)currentComponents.get(i);
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
XSObjectList memberTypes = ((XSSimpleTypeDefinition)comp).getMemberTypes();
for (int j = 0, nt = memberTypes.size(); j < nt; ++j) {
addComponent((XSObject)memberTypes.get(j), step.getNametest(), result);
}
}
}
}
break;
case Axis.PRIMITIVE_TYPE:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.TYPE_DEFINITION) {
XSObject comp = (XSObject)currentComponents.get(i);
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
addComponent(((XSSimpleTypeDefinition)comp).getPrimitiveType(),
step.getNametest(), result);
}
}
}
break;
case Axis.KEY:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
if (((XSObject)currentComponents.get(i)).getType() == XSConstants.IDENTITY_CONSTRAINT) {
addComponent(((XSIDCDefinition)currentComponents.get(i)).getRefKey(),
step.getNametest(), result);
}
}
break;
case Axis.ANNOTATION:
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
annotations((XSObject)currentComponents.get(i), result);
}
break;
case Axis.ATTRIBUTE_USE: {
XSObjectList attribUses = null;
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = (XSObject)currentComponents.get(i);
if (comp.getType() == XSConstants.TYPE_DEFINITION) {
if (((XSTypeDefinition)comp).getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE) {
attribUses = ((XSComplexTypeDefinition)comp).getAttributeUses();
}
} else if (comp.getType() == XSConstants.ATTRIBUTE_GROUP) {
attribUses = ((XSAttributeGroupDefinition)comp).getAttributeUses();
}
if (attribUses != null) {
for (int j = 0, na = attribUses.size(); j < na; ++j) {
addComponent((XSObject)attribUses.get(j),
step.getNametest(), result);
}
}
}
}
break;
case Axis.PARTICLE: {
for (int i = 0, n = currentComponents.size(); i < n; ++i) {
XSObject comp = (XSObject)currentComponents.get(i);
if (comp.getType() == XSConstants.MODEL_GROUP) {
XSObjectList particles = ((XSModelGroup)comp).getParticles();
for (int j = 0, np = particles.size(); j < np; ++j) {
addComponent((XSObject) particles.get(j),
step.getNametest(), result);
}