final Path filePath = snapshotDir.resolve(exportSnapshot.id + "-snapshot.json");
LOG.debug("Creating JSON file : {}", filePath);
final Path filePath = snapshotDir.resolve(exportSnapshot.id + "-snapshot.json");
LOG.debug("Creating JSON file : {}", filePath);
checkState(root instanceof NormalizedNodeContainer, "Unexpected root %s", root);
writeSnapshot(filePath, (NormalizedNodeContainer<?>) root);
checkState(root instanceof NormalizedNodeContainer, "Unexpected root %s", root);
writeSnapshot(filePath, (NormalizedNodeContainer<?>) root);
private static void doWriteNode(final JsonWriter writer, final YangInstanceIdentifier path,
final DataTreeCandidateNode node) throws IOException {
private static void doWriteNode(final JsonWriter writer, final YangInstanceIdentifier path,
final DataTreeCandidateNode node) throws IOException {
private static void outputNodeInfo(final JsonWriter writer, final YangInstanceIdentifier path,
final DataTreeCandidateNode node) throws IOException {
private static void outputNodeInfo(final JsonWriter writer, final YangInstanceIdentifier path,
final DataTreeCandidateNode node) throws IOException {
writer.beginObject().name("Node");
writer.beginArray();
writer.beginObject().name("Path").value(path.toString()).endObject();
writer.beginObject().name("ModificationType").value(modificationType.toString()).endObject();
if (modificationType == ModificationType.WRITE) {
writer.beginObject().name("Node");
writer.beginArray();
writer.beginObject().name("Path").value(path.toString()).endObject();
writer.beginObject().name("ModificationType").value(modificationType.toString()).endObject();
if (modificationType == ModificationType.WRITE) {
writer.beginArray();
writer.beginObject().name("Path").value(path.toString()).endObject();
writer.beginObject().name("ModificationType")
writer.beginArray();
writer.beginObject().name("Path").value(path.toString()).endObject();
writer.beginObject().name("ModificationType")
NodeIterator next(final JsonWriter writer) throws IOException {
while (iterator.hasNext()) {
final DataTreeCandidateNode node = iterator.next();
NodeIterator next(final JsonWriter writer) throws IOException {
while (iterator.hasNext()) {
final DataTreeCandidateNode node = iterator.next();