Package uk.ac.starlink.tfcat
Interface Decoder<T>
- Type Parameters:
T
- output type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Turns a JSON object into a typed java object.
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(Reporter reporter, Object json, TfcatObject parent) Takes a parsed JSON object (may be an array or something else) and attempts to decode it into an object of this decoder's parameterised type.
-
Method Details
-
decode
Takes a parsed JSON object (may be an array or something else) and attempts to decode it into an object of this decoder's parameterised type. In case of failure, null is returned. Any fatal or recoverable errors encountered during decoding should be reported through the supplied reporter.- Parameters:
reporter
- destination for error messagesjson
- input JSON objectparent
- parent object, may be null- Returns:
- decoded object, or null
-