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.

@FunctionalInterface public interface Decoder<T>
Turns a JSON object into a typed java object.

## Method Summary

Modifier and Type
Method
Description
`T`
`decode(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

T decode(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. 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 messages
  `json` - input JSON object
  `parent` - parent object, may be null
Returns:
  decoded object, or null