Search in sources :

Example 6 with MPersistent

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"));
    }
}
Also used : MPersistent(gov.sandia.n2a.db.MPersistent)

Aggregations

MPersistent (gov.sandia.n2a.db.MPersistent)6 MNode (gov.sandia.n2a.db.MNode)3 TreeMap (java.util.TreeMap)2 MPart (gov.sandia.n2a.eqset.MPart)1