Package com.cedarsoftware.io
Class JsonIo.ToonStringBuilder
java.lang.Object
com.cedarsoftware.io.JsonIo.ToonStringBuilder
- Enclosing class:
- JsonIo
Builder for converting a TOON string to Java objects.
This builder completes the TOON parsing process started by JsonIo.fromToon(String, ReadOptions).
It provides methods to specify the target type for the deserialization.
-
Method Summary
Modifier and TypeMethodDescription<T> TCompletes the TOON parsing by specifying a target class.<T> TasType(TypeHolder<T> typeHolder) Completes the TOON parsing by specifying a generic type.
-
Method Details
-
asClass
Completes the TOON parsing by specifying a target class.- Type Parameters:
T- the type to convert the TOON to- Parameters:
clazz- the target class; if null, the type will be inferred from the TOON- Returns:
- an instance of the specified class populated from the TOON
- Throws:
JsonIoException- if an error occurs during parsing or conversion
-
asType
Completes the TOON parsing by specifying a generic type.- Type Parameters:
T- the type to convert the TOON to- Parameters:
typeHolder- a TypeHolder instance capturing the full generic type- Returns:
- an object of the specified type populated from the TOON
- Throws:
JsonIoException- if an error occurs during parsing or conversion
-