I am using Google\'s GSON package http://code.google.com/p/google-gson/
I am converting JSON to Java.
I have this fragment of code where I do the conversion.
Sounds like you want to create a custom deserializer if you need to check the values, or an instance creator if you only need to create an instance based on type.