blob: 23605bf8a52cf9980a43e7ac09d48f099eee2689 [file] [log] [blame]
package aQute.lib.json;
import java.lang.reflect.*;
import java.util.*;
public class CharacterHandler extends Handler {
@Override
void encode(Encoder app, Object object, Map<Object,Type> visited) throws Exception {
Character c = (Character) object;
int v = c.charValue();
app.append(v + "");
}
@Override
Object decode(boolean s) {
return s ? 't' : 'f';
}
@Override
Object decode(String s) {
return (char) Integer.parseInt(s);
}
@Override
Object decode(Number s) {
return (char) s.shortValue();
}
@Override
Object decode() {
return 0;
}
}