パッケージ com.shimizukenta.jsonhub
インタフェース JsonHubPrettyPrinter
public interface JsonHubPrettyPrinter
This interface is implements of pretty-printing JSON.
- To get default-printer,
getDefaultPrinter()
. - To get compact-printer,
getCompactPrinter()
. - To get compact-and-exclude-null-value-in-object-printer,
getNoneNullValueInObjectCompactPrinter()
. - To get custom-printer,
newPrinter(JsonHubPrettyPrinterConfig)
.
- To get Pretty-JSON-String,
print(JsonHub)
. - To print to writer,
print(JsonHub, Writer)
. - To print to file,
print(JsonHub, Path)
. - To print to file with options,
print(JsonHub, Path, OpenOption...)
.
-
メソッドの概要
修飾子とタイプ メソッド 説明 static JsonHubPrettyPrinter
getCompactPrinter()
Returns Compact-pretty-printer instance.static JsonHubPrettyPrinter
getDefaultPrinter()
Returns Default-pretty-printer instancestatic JsonHubPrettyPrinter
getNoneNullValueInObjectCompactPrinter()
Returns Compact-and-exclude-null-value-in-object-pretty-printer instance.static JsonHubPrettyPrinter
newPrinter(JsonHubPrettyPrinterConfig config)
Returns Customized-pretty-printer instance.java.lang.String
print(JsonHub value)
Returns Pritty-JSON-String.void
print(JsonHub value, java.io.Writer writer)
Write to writervoid
print(JsonHub value, java.nio.file.Path path)
Write to File.void
print(JsonHub value, java.nio.file.Path path, java.nio.file.OpenOption... options)
Write to File with options.
-
メソッドの詳細
-
print
Write to writer- パラメータ:
value
- the JsonHubwriter
- output writer- 例外:
java.io.IOException
- if IO failed
-
print
Write to File.- パラメータ:
value
- the JsonHubpath
- output file-path- 例外:
java.io.IOException
- if IO failed
-
print
void print(JsonHub value, java.nio.file.Path path, java.nio.file.OpenOption... options) throws java.io.IOExceptionWrite to File with options.- パラメータ:
value
- the JsonHubpath
- output file-pathoptions
- the File-open-options.- 例外:
java.io.IOException
- if IO failed
-
print
Returns Pritty-JSON-String.- パラメータ:
value
- the JsonHub- 戻り値:
- Pretty-JSON-String
-
getDefaultPrinter
Returns Default-pretty-printer instance- 戻り値:
- Default-pretty-printer instance
-
newPrinter
Returns Customized-pretty-printer instance.- パラメータ:
config
- the config- 戻り値:
- Customized-pretty-printer instance
-
getCompactPrinter
Returns Compact-pretty-printer instance.- 戻り値:
- Compact-JSON-pretty-printer instance
-
getNoneNullValueInObjectCompactPrinter
Returns Compact-and-exclude-null-value-in-object-pretty-printer instance.- 戻り値:
- Compact-and-exclude-null-value-in-object-pretty-printer instance
-