use of org.javarosa.core.model.util.restorable.Restorable in project javarosa by opendatakit.
the class XFormParser method restoreDataModel.
public static FormInstance restoreDataModel(Document doc, Class restorableType) {
Restorable r = (restorableType != null ? (Restorable) PrototypeFactory.getInstance(restorableType) : null);
Element e = doc.getRootElement();
TreeElement te = buildInstanceStructure(e, null, buildNamespacesMap(e), null);
FormInstance dm = new FormInstance(te);
loadNamespaces(e, dm);
if (r != null) {
RestoreUtils.templateData(r, dm, null);
}
loadInstanceData(e, te, null);
return dm;
}
Aggregations