blob: f002f50d464877173e9e539c15595b380a2b4da2 [file] [log] [blame]
Stuart McCullochbb014372012-06-07 21:57:32 +00001package aQute.lib.json;
2
3import java.io.*;
4import java.lang.reflect.*;
5import java.util.*;
6
7abstract class Handler {
Stuart McCulloch2286f232012-06-15 13:27:53 +00008 abstract void encode(Encoder app, Object object, Map<Object,Type> visited) throws IOException, Exception;
Stuart McCullochbb014372012-06-07 21:57:32 +00009
10 Object decodeObject(Decoder isr) throws Exception {
11 throw new UnsupportedOperationException("Cannot be mapped to object " + this);
12 }
13
14 Object decodeArray(Decoder isr) throws Exception {
15 throw new UnsupportedOperationException("Cannot be mapped to array " + this);
16 }
17
18 Object decode(String s) throws Exception {
19 throw new UnsupportedOperationException("Cannot be mapped to string " + this);
20 }
21
22 Object decode(Number s) throws Exception {
23 throw new UnsupportedOperationException("Cannot be mapped to number " + this);
24 }
25
26 Object decode(boolean s) {
27 throw new UnsupportedOperationException("Cannot be mapped to boolean " + this);
28 }
29
30 Object decode() {
31 return null;
32 }
33
34}