- Collections.sort(unknownNodes, Comparators.SCHEMA_NODE_COMP);
- instance.addUnknownSchemaNodes(unknownNodes);
+ instance.targetPath = SchemaPath.create(newPath, false);
+ } else {
+ instance.targetPath = targetNodeSchemaPath;
+ }
+
+ if (copyOf != null) {
+ instance.setCopyOf(copyOf.build());
+ }
+
+ RevisionAwareXPath whenStmt;
+ if (whenCondition == null) {
+ whenStmt = null;
+ } else {
+ whenStmt = new RevisionAwareXPathImpl(whenCondition, false);
+ }
+ instance.whenCondition = whenStmt;
+
+ // CHILD NODES
+ for (DataSchemaNodeBuilder node : addedChildNodes) {
+ childNodes.put(node.getQName(), node.build());
+ }
+ instance.childNodes = ImmutableSet.copyOf(childNodes.values());