Package org.loxlylabs.nestedtext
Class NestedTexts
java.lang.Object
org.loxlylabs.nestedtext.NestedTexts
Utility class to serialize or deserialize with default configuration.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringDumps an object to a NestedText string using default settings.static NestedText.Readerfrom(byte[] data) Begins a fluent deserialization operation from a byte[] source.static NestedText.ReaderBegins a fluent deserialization operation from a String source.static NestedText.ReaderBegins a fluent deserialization operation from a Path source.
-
Method Details
-
dump
Dumps an object to a NestedText string using default settings.- Parameters:
obj- The object to serialize.- Returns:
- The NestedText string representation.
-
from
Begins a fluent deserialization operation from a String source.- Parameters:
content- The NestedText string content.- Returns:
- A
NestedText.Readerinstance to specify the target type. - Throws:
NestedTextException- if the string is not valid NestedText.
-
from
Begins a fluent deserialization operation from a Path source.- Parameters:
path- The path to the file containing NestedText.- Returns:
- A
NestedText.Readerinstance to specify the target type. - Throws:
NestedTextException- if the file content is not valid NestedText.IOException- if an I/O error occurs while reading the file.
-
from
Begins a fluent deserialization operation from a byte[] source.- Parameters:
data- The byte array containing NestedText data.- Returns:
- A
NestedText.Readerinstance to specify the target type. - Throws:
NestedTextException- if the byte array is not valid UTF-8 or if the decoded string is not valid NestedText.
-