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