Class ObjectEncoder
java.lang.Object
dev.toonformat.jtoon.encoder.ObjectEncoder
Handles encoding of JSON objects to TOON format.
Recursively encodes nested objects and delegates arrays to ArrayEncoder.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidencodeKeyValuePair(String key, tools.jackson.databind.JsonNode value, LineWriter writer, int depth, EncodeOptions options) Encodes a key-value pair in an object.static voidencodeObject(tools.jackson.databind.node.ObjectNode value, LineWriter writer, int depth, EncodeOptions options) Encodes an ObjectNode to TOON format.
-
Method Details
-
encodeObject
public static void encodeObject(tools.jackson.databind.node.ObjectNode value, LineWriter writer, int depth, EncodeOptions options) Encodes an ObjectNode to TOON format.- Parameters:
value- The ObjectNode to encodewriter- LineWriter for accumulating outputdepth- Current indentation depthoptions- Encoding options
-
encodeKeyValuePair
public static void encodeKeyValuePair(String key, tools.jackson.databind.JsonNode value, LineWriter writer, int depth, EncodeOptions options) Encodes a key-value pair in an object.- Parameters:
key- the key namevalue- the value to encodewriter- the LineWriter for accumulating outputdepth- the current indentation depthoptions- encoding options
-