if (obj.getConstructionClass().getIsNamedBy().getType().getIsHierarchicName()){
DmcHierarchicObjectName hon = ((DmwHierarchicObjectWrapper)obj).getObjectName();
DmcHierarchicObjectName pn = hon.getParentName();
if (pn != null){
DmwHierarchicObjectWrapper po = (DmwHierarchicObjectWrapper) theCache.get(pn);
if(po == null){
ResultException ex = new ResultException();
ex.addError("Could not find parent object: " + po + " for object: " + hon);
throw(ex);
}
if (obj.getConstructionClass().allowsParent(po.getConstructionClass())){
po.addSubComponent((DmwHierarchicObjectWrapper) obj);
}
else{
ResultException ex = new ResultException();
ex.addError("Object of class: " + po.getConstructionClassName() + " is not a valid parent for object of class: " + obj.getConstructionClassName());
throw(ex);
}
}
}