throw new IllegalArgumentException("Structure cannot be null");
if (location == null)
throw new IllegalArgumentException("location cannot be null");
Structure parent = null;
switch (structure.getStructureType()) {
case Structure.ELEMENT:
parent = ((ElementDecl)structure).getParent();
if (parent.getStructureType() != Structure.SCHEMA)
getSchemaLocation(parent, location);
location.append(PATH_SEPARATOR);
location.append(((ElementDecl)structure).getName());
break;
case Structure.COMPLEX_TYPE:
ComplexType complexType = (ComplexType)structure;
parent = (complexType).getParent();
if (parent.getStructureType() != Structure.SCHEMA)
getSchemaLocation(parent, location);
if (complexType.getName() != null) {
location.append(COMPLEXTYPE_ID);
location.append(((ComplexType)structure).getName());
}
break;
case Structure.MODELGROUP:
ModelGroup group = (ModelGroup)structure;
parent = group.getParent();
if (parent.getStructureType() != Structure.SCHEMA)
getSchemaLocation(parent, location);
if (group.getName() != null) {
location.append(GROUP_ID);
location.append(group.getName());
}
break;
case Structure.ATTRIBUTE:
parent = ((AttributeDecl)structure).getParent();
if (parent.getStructureType() != Structure.SCHEMA)
getSchemaLocation(parent, location);
location.append(PATH_SEPARATOR);
location.append(ATTRIBUTE_PREFIX);
location.append(((AttributeDecl)structure).getName());
break;