use of org.javarosa.core.services.storage.IStorageIterator in project javarosa by opendatakit.
the class RestoreUtils method exportRMS.
public static FormInstance exportRMS(IStorageUtility storage, Class type, String parentTag, IRecordFilter filter) {
if (!Externalizable.class.isAssignableFrom(type) || !Restorable.class.isAssignableFrom(type)) {
return null;
}
FormInstance dm = newDataModel(parentTag);
IStorageIterator ri = storage.iterate();
while (ri.hasMore()) {
Object obj = ri.nextRecord();
if (filter == null || filter.filter(obj)) {
FormInstance objModel = ((Restorable) obj).exportData();
mergeDataModel(dm, objModel, topRef(dm));
}
}
return dm;
}
Aggregations