+ def findModuleByNameAndRevision(QName module) {
+ checkPreconditions
+ checkArgument(module !== null && module.localName !== null && module.revision !== null)
+ return globalSchema.findModuleByName(module.localName, module.revision)
+ }
+
+ def findModuleByNameAndRevision(MountInstance mountPoint, QName module) {
+ checkPreconditions
+ checkArgument(module !== null && module.localName !== null && module.revision !== null && mountPoint !== null)
+ return mountPoint.schemaContext?.findModuleByName(module.localName, module.revision)
+ }
+
+ def getDataNodeContainerFor(InstanceIdentifier path) {
+ checkPreconditions
+ val elements = path.path;
+ val startQName = elements.head.nodeType;
+ val initialModule = globalSchema.findModuleByNamespaceAndRevision(startQName.namespace, startQName.revision)
+ var node = initialModule as DataNodeContainer;
+ for (element : elements) {
+ val potentialNode = node.childByQName(element.nodeType);
+ if (potentialNode === null || !potentialNode.listOrContainer) {
+ return null
+ }
+ node = potentialNode as DataNodeContainer
+ }
+ return node
+ }
+