Commit c855ab0c authored by Cristina Cocho's avatar Cristina Cocho
Browse files

added function to check if an spy is autogenerated

parent b5e261c0
......@@ -655,11 +655,34 @@ public class PropertyManager {
return dynamicChildNames;
}
public Set<SpyPropertyDescriptor> getSpyListOfPropertyDescriptor(String controllerName) {
/**
* New spy: retrieve data about the properties that need to be displayed
* @param controllerName
* @return
*/
public Set<SpyPropertyDescriptor> getListOfpropertyDescriptorForSpy(String controllerName) {
int servantId = ServantDatabase.getInstance().getServantId(controllerName);
return PropertyDatabase.getInstance().getSpyPropertyDescriptors(servantId);
}
public boolean isAnAutogeneratedSpy(String controllerName) {
Set<SpyPropertyDescriptor> setOfDescriptors = getListOfpropertyDescriptorForSpy(controllerName);
if (setOfDescriptors != null && setOfDescriptors.size() == 1) {
// Verify the only property loaded is not a commandStatus property (maybe this situation never takes place)
Iterator<SpyPropertyDescriptor> it = setOfDescriptors.iterator();
SpyPropertyDescriptor spyDescriptor = it.next();
int actualPropertyID = spyDescriptor.getActualID();
String actualPropertyName = PropertyDatabase.getInstance().getPropertyName(actualPropertyID);
if (actualPropertyName.equals("commandStatus")) {
return false;
}
return true;
}
return false;
}
/**
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment