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 { |
Stuart McCulloch | 2286f23 | 2012-06-15 13:27:53 +0000 | [diff] [blame] | 8 | abstract void encode(Encoder app, Object object, Map<Object,Type> visited) throws IOException, Exception; |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 9 | |
Stuart McCulloch | d482610 | 2012-06-26 16:34:24 +0000 | [diff] [blame^] | 10 | Object decodeObject(@SuppressWarnings("unused") Decoder isr) throws Exception { |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 11 | throw new UnsupportedOperationException("Cannot be mapped to object " + this); |
| 12 | } |
| 13 | |
Stuart McCulloch | d482610 | 2012-06-26 16:34:24 +0000 | [diff] [blame^] | 14 | Object decodeArray(@SuppressWarnings("unused") Decoder isr) throws Exception { |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 15 | throw new UnsupportedOperationException("Cannot be mapped to array " + this); |
| 16 | } |
| 17 | |
Stuart McCulloch | d482610 | 2012-06-26 16:34:24 +0000 | [diff] [blame^] | 18 | Object decode(@SuppressWarnings("unused") String s) throws Exception { |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 19 | throw new UnsupportedOperationException("Cannot be mapped to string " + this); |
| 20 | } |
| 21 | |
Stuart McCulloch | d482610 | 2012-06-26 16:34:24 +0000 | [diff] [blame^] | 22 | Object decode(@SuppressWarnings("unused") Number s) throws Exception { |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 23 | throw new UnsupportedOperationException("Cannot be mapped to number " + this); |
| 24 | } |
| 25 | |
Stuart McCulloch | d482610 | 2012-06-26 16:34:24 +0000 | [diff] [blame^] | 26 | Object decode(@SuppressWarnings("unused") boolean s) { |
Stuart McCulloch | bb01437 | 2012-06-07 21:57:32 +0000 | [diff] [blame] | 27 | throw new UnsupportedOperationException("Cannot be mapped to boolean " + this); |
| 28 | } |
| 29 | |
| 30 | Object decode() { |
| 31 | return null; |
| 32 | } |
| 33 | |
| 34 | } |