use of gov.sandia.n2a.db.MPersistent in project n2a by frothga.
the class MPart method getIDs.
/**
* Subroutine of set() which locates each parent and records its ID.
* Must only be called on an $inherit node in the top-level document.
*/
protected synchronized void getIDs() {
// Remove children. This will have to change if we ever store other metadata under $inherit (such as a comment).
if (children != null)
releaseOverrideChildren();
String[] parentNames = get().split(",");
for (int i = 0; i < parentNames.length; i++) {
String parentName = parentNames[i];
parentName = parentName.trim().replace("\"", "");
MPersistent parentSource = (MPersistent) AppData.models.child(parentName);
if (parentSource != null)
set(i, parentSource.get("$metadata", "id"));
}
}
Aggregations