ClassPathContracts

The one reader of the peer contracts on a class path: every PeerContracts.RESOURCE, one per api jar (or directory) that carries the contracts of its contexts, each parsed by the caller's JSON library into the plain tree ManifestTree.read reads, so this module stays free of one. The same contract found twice is read once. A node's contract directory and wow-client's command names both read through it.

Functions

Link copied to clipboard
fun load(classLoader: ClassLoader, warn: (String) -> Unit = {}, parse: (ByteArray) -> Any?): List<ManifestFragment>

The contracts on classLoader, each parsed by parse; a ContractException listing every contract that cannot be read, is not JSON (parse throws) or does not read as a Manifest. A contract of a peer newer than this reader may hold values it does not know: they are read leniently (ManifestTree.read) and told to warn.