blob: c5e8b174b3486845afbb7b53c2bbda1d6130971a [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
Stuart McCullochd4826102012-06-26 16:34:24 +000010 Object decodeObject(@SuppressWarnings("unused") Decoder isr) throws Exception {
Stuart McCullochbb014372012-06-07 21:57:32 +000011 throw new UnsupportedOperationException("Cannot be mapped to object " + this);
12 }
13
Stuart McCullochd4826102012-06-26 16:34:24 +000014 Object decodeArray(@SuppressWarnings("unused") Decoder isr) throws Exception {
Stuart McCullochbb014372012-06-07 21:57:32 +000015 throw new UnsupportedOperationException("Cannot be mapped to array " + this);
16 }
17
Stuart McCullochd4826102012-06-26 16:34:24 +000018 Object decode(@SuppressWarnings("unused") String s) throws Exception {
Stuart McCullochbb014372012-06-07 21:57:32 +000019 throw new UnsupportedOperationException("Cannot be mapped to string " + this);
20 }
21
Stuart McCullochd4826102012-06-26 16:34:24 +000022 Object decode(@SuppressWarnings("unused") Number s) throws Exception {
Stuart McCullochbb014372012-06-07 21:57:32 +000023 throw new UnsupportedOperationException("Cannot be mapped to number " + this);
24 }
25
Stuart McCullochd4826102012-06-26 16:34:24 +000026 Object decode(@SuppressWarnings("unused") boolean s) {
Stuart McCullochbb014372012-06-07 21:57:32 +000027 throw new UnsupportedOperationException("Cannot be mapped to boolean " + this);
28 }
29
30 Object decode() {
31 return null;
32 }
33
34}