-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yang-tool: Support add, replace and delete deviation
- Loading branch information
Showing
11 changed files
with
513 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
yang-lsp/io.typefox.yang/src/main/java/io/typefox/yang/processor/JsonSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.typefox.yang.processor; | ||
|
||
import com.google.gson.GsonBuilder; | ||
|
||
import io.typefox.yang.processor.ProcessedDataModel.ModuleData; | ||
|
||
public class JsonSerializer { | ||
|
||
public CharSequence serialize(ModuleData moduleData) { | ||
var writer = new StringBuilder(); | ||
serialize(moduleData, writer); | ||
return writer.toString(); | ||
} | ||
|
||
public void serialize(ModuleData moduleData, Appendable writer) { | ||
new GsonBuilder().setPrettyPrinting().create().toJson(moduleData, writer); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.