private static boolean isNameUsedInHierarchy(String aName, FIBModelObject object) { if (object.getName() != null && object.getName().equals(aName)) { return true; } if (object.getEmbeddedObjects() != null) { for (FIBModelObject o : object.getEmbeddedObjects()) { if (isNameUsedInHierarchy(aName, o)) return true; } } return false; }
private static List<FIBModelObject> retrieveObjectsWithName( String aName, FIBModelObject object, List<FIBModelObject> list) { if (object.getName() != null && object.getName().equals(aName)) { list.add(object); } if (object.getEmbeddedObjects() != null) { for (FIBModelObject o : object.getEmbeddedObjects()) { retrieveObjectsWithName(aName, o, list); } } return list; }