Allow @JSON annotation on fields.
Added alternate field name in JSON stream from property name using @JSON.
Added support for defining Transformers and ObjectFactories using @JSON.
Add methods to DateObjectFactory to make it easier to add new patterns per instance, as well as class level default formats.
3419090 - Added BooleanAsStringTransformer and BooleanAsObjectBinder to handle writing out a Boolean as Strings.
Better handling of BigInteger and BigDecimal so you don't have to handle them separately. Introduced JsonNumber instead of converting numbers to fixed quantities like Double, Long, Integer, etc. This can have an impact on custom ObjectFactories so be aware if you have written custom ObjectFactories. Treat all expect numeric values as java.lang.Number and you shouldn't have any problems.
java.util.Calendar was not recognized as a default serialized type, and would throw exceptions.
32113835 - @JSON could not be used on field definitions.
3167237 - Transient fields were being included when they should not be.
3130753 - Deserialization was using Class.forName instead of ContextClassLoader.
Map fields were being included on Shallow serialization when they shouldn't be.
Documentation had not been updated ...
3441147 - Fixed threading issues with DateFormat when used in DateTransformer and DateObjectFactory.
3110872 - TypeTransformerMap wasn't going up the chain for super interfaces properly.
3449532 - Extra comma could be written out if there were circular references in collections.
3122442 - Properties without getters were being written out as null when they shouldn't.
3485430 - Registering an ObjectFactory on a super class type wasn't being used for subclasses.
Added default Transformer for handling java.util.Calendar instances.
Fixed underflow issues where a Date that could fit inside an Integer was being returned as an Int instead of Long.
Removed usage java.beans.Introspector and replaced it with a specialized solution so Flexjson could be ported to Android. This also fixed several other bugs that Introspector couldn't fix.
Added a new ObjectFactory ExistingObjectFactory to support deserializing into an existing object.
Added a shorthand method JSONDeserializer.deserializeInto() to deserialize into an existing object without needing to configure ExistingObjectFactory explicitly.
Added methods to parse json input from a java.io.Reader instance for JSONDeserializer. This allows you to skip the overhead of creating a String then transforming that to the stream.
Fixed a bug related to deserializing into subclasses of Date like Timestamp that don't have a no-arg constructor. It now uses a constructor that takes a single long value argument.
Fixed bug 3062102: 2.0 regressed a problem serializing maps containing nulls for keys and values. Now Maps containing nulls (either key or value) will serialize correctly.
Public fields weren't being deserialized at all because of Introspector not returning properties for public fields. Now with the switch to BeanAnalyzer the code is properly handling public fields during deserialization.
Huge refactoring to enable Transformers to be registered anywhere in the object graph when doing serialization. JSONSerializer uses Transformers as the underpinnings for doing serialization. JSONSerializer is built on top of a collection of Transformers that the user can override with their own implementation. Transformer's interfaces were changed to they are incompatible with Transformers using the 1.x code base.
Huge refactoring to add ObjectBinder to be used anywhere in the object graph when doing deserialization. It serves as the underpinnings for doing the mapping into Objects so JSONDeserializer is built on top of a collection of ObjectBinders. The user can override any ObjectBinder with their own implementation.
JSONSerializer supports direct serialization to a java.io.Writer instead of using Strings.
JSONDeserializer added a method to specify the root class within the deserialize() method call cutting down on the confusion around how to register an object on the root path using null. Also makes code much clearer and cleaner.
ClassLocatorObjectFactory assumes value objects are Map objects which isn't true if you register a ClassLocator on a path that has Arrays in it. Since we don't have a Map object corresponding to that path we pass an empty Map into the ClassLocator to indicate the value at this location isn't a Map.
Fix for ClassLocators when using mixed maps. ClassLocatorObjectFactory incorrectly casts targetType to ParameterizedType without a check. Now it tests to see if it's a ParameterizedType before down casting.
Fix for 2910131: Data types Double and double primitive were not recognized by the JSONDeserializer object by default. ObjectBinder now has a ObjectFactory registered by default for both Double and double classes.
Fix for 2905865: Added version number to the manifest file in the jar file.
Fix for 2899667: Null properties in the json were not being passed to the binding phase so null properties would be dropped when deserializing. Changed the JSONTokenizer to NOT filter based on the value being null.
Fix for 2908854: Deserializing a non-generized Map (i.e. List<Map>) threw a ClassCastException. This is fixed by changing the ObjectFactory responsible for maps to handle non-generized Maps, and fixes in the path expressions for 1.9 enable the user to specify the data types for keys and values.
Refactored path listings for Maps and Collections. In prior versions there was no way to specify both the concrete top of a Collection/Map AND the concrete class contained within. The path language was not verbose enough. Now you can specify both the concrete collection AND the concrete class contained within. if person.friends is a path that points to java.util.Map. For example,
new JSONDeserializer<Person>() .use( "person.friends", HashMap.class ) .use("person.friends.keys", Relation.class ) .use( "person.friends.values", Person.class )
By adding "keys" and "values" to the path person.friends you can specify the actual concrete classes to use for the keys and values of the Map. For Collections you can simply append "values" to specify the containing class. For example:
new JSONDeserializer<List<Person>>().use( "people", ArrayList.class ).use("people.values", Person.class )
new Date( ... ). It has been changed to send the time as the number of milliseconds since midnight, January 1, 1970 UTC.