* @return the EOful object
*/
public static Object convertGIDtoEO(EOEditingContext editingContext, Object obj) {
Object result;
if (obj instanceof EOGlobalID) {
EOGlobalID gidful = (EOGlobalID)obj;
EOEnterpriseObject eoful = ERXEOGlobalIDUtilities.fetchObjectWithGlobalID(editingContext, gidful);
result = eoful;
}
else if (obj instanceof IERXGIDContainer) {
result = ((IERXGIDContainer)obj).toEOContainer(editingContext);
}
else if (obj instanceof NSArray) {
NSArray gidful = (NSArray)obj;
boolean allGIDs = true;
Enumeration objEnum = gidful.objectEnumerator();
while (allGIDs && objEnum.hasMoreElements()) {
allGIDs = (objEnum.nextElement() instanceof EOGlobalID);
}
if (allGIDs) {
result = ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gidful);
}
else {
NSMutableArray eoful = new NSMutableArray();
objEnum = gidful.objectEnumerator();
while (objEnum.hasMoreElements()) {
eoful.addObject(ERXEOControlUtilities.convertGIDtoEO(editingContext, objEnum.nextElement()));
}
result = eoful;
}
}
else if (obj instanceof NSSet) {
NSSet gidful = (NSSet)obj;
boolean allGIDs = true;
Enumeration objEnum = gidful.objectEnumerator();
while (allGIDs && objEnum.hasMoreElements()) {
allGIDs = (objEnum.nextElement() instanceof EOGlobalID);
}
if (allGIDs) {
result = new NSSet(ERXEOGlobalIDUtilities.fetchObjectsWithGlobalIDs(editingContext, gidful.allObjects()));
}
else {
NSMutableSet eoful = new NSMutableSet();
objEnum = gidful.objectEnumerator();
while (objEnum.hasMoreElements()) {
eoful.addObject(ERXEOControlUtilities.convertGIDtoEO(editingContext, objEnum.nextElement()));
}
result = eoful;
}
}
else if (obj instanceof NSDictionary) {
NSDictionary gidful = (NSDictionary)obj;
NSMutableDictionary eoful = new NSMutableDictionary();
Enumeration keyEnum = gidful.keyEnumerator();
while (keyEnum.hasMoreElements()) {
Object gidfulKey = keyEnum.nextElement();
Object eofulKey = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidfulKey);
Object eofulValue = ERXEOControlUtilities.convertGIDtoEO(editingContext, gidful.objectForKey(gidfulKey));
eoful.setObjectForKey(eofulValue, eofulKey);
}
result = eoful;
}
else {