Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Releases: vimeo/stag-java

Version 2.1.3

02 May 01:00
Compare
Choose a tag to compare
  • Improved performance of generic type adapter instantiation.
  • Fixed bug where the type adapter for a parameterized type containing a parameterized type (e.g. Map<T, List<T>>) wasn't being generated.
  • Thanks to @yasirmhd and @anirudhramanan for their contributions to this release.

Version 2.1.2

13 Apr 00:24
Compare
Choose a tag to compare
  • Fixed a bug where Object fields caused type adapter generation to fail.
  • Thanks to @garganshul for the bugfix

Version 2.1.1

10 Apr 14:24
Compare
Choose a tag to compare
  • Fixed regression bug where enums could not have private and/or final fields.

Version 2.1.0

07 Apr 19:43
Compare
Choose a tag to compare
  • WARNING: Removed deprecated @GsonAdapterKey annotation.
  • Added support for the @JsonAdapter Gson annotation.
  • Fixed bad behavior where unannotated classes could be picked up by Stag if they were nested within annotated classes. All classes that need to use Stag should now explicitly specify the option.
  • Added unit tests for a variety of use cases.
  • Thanks to @garganshul, @yasirmhd, and @mcumings for their contributions to this release

Version 2.0.2

02 Mar 15:08
Compare
Choose a tag to compare
  • Interfaces are now ignored by stag instead of throwing an error if they are annotated.
  • Fixed bug where type adapters for self referential classes (see sample/ExternalModelExample2) would cause stack overflows when instantiated.
  • Fixed bug where duplicate type adapters would be generated if a class in one module extended a class in another module.
  • Fixed bug where the type adapter for char arrays was broken.
  • Correctly suppress raw types in generated code so as to not interfere with compilation settings on projects.
  • Added unit tests for all model classes to validate the creation of type adapters and their ability to be instantiated.
  • Added unit tests to validate type adapters in KnownTypeAdapters.
  • Thanks to @yasirmhd, @anirudhramanan, and @mcumings for their work on this release

Version 2.0.1

31 Jan 14:49
Compare
Choose a tag to compare
  • Fixed backwards compatibility bug where Stag wasn't generating TypeAdapters for classes containing only @GsonAdapterKey. (Please note that it's still advised to move away from @GsonAdapterKey as soon as possible).
  • Fixed bug where inner classes of classes annotated with @UseStag were always using FieldOption.ALL instead of inheriting the enclosing class's field option.
  • Fixed bug where Stag was not generating TypeAdapters for inner classes annotated with @UseStag nested within classes that aren't annotated. Thanks to @mcumings for this.
  • Added annotation processor option to enable debug output by Stag when compiling. Thanks to @mcumings for this.

Version 2.0.0

26 Jan 21:56
Compare
Choose a tag to compare
  • Added @UseStag class level annotation
    • Use at the class level to mark a class to be processed by Stag
    • The goal of @UseStag is that it should be the only change you need to make to switch from your old non-Stag ready model to a better performing one. One annotation per model class, instead of the old Stag (different annotation for every field).
    • @UseStag takes FieldOption enum which specifies what fields Stag should pick up
      • FieldOption.ALL: marks all fields in a class for adapter generation. This is the default setting used by Stag if you don't specify any field option. This is the option you should choose in most scenarios. Unless marked with a @SerializedName annotation, the variable name will be used as the JSON key. There is no longer a reason to mark fields with @GsonAdapterKey to have them be picked up by Stag.
      • FieldOption.NONE: marks the class for adapter generation, but none of the class's immediate fields will be picked up by Stag. Only fields in the inheritance hierarchy will be picked up. See VideoList.java for an example of a class that has no immediate fields that need parsing, but has inherited fields.
      • FieldOption.SERIALIZED_NAME: This option only chooses fields marked with the @SerializedName or @GsonAdapterKey to be used by Stag. This will behave the same way as the previous versions of stag behaved.
  • Added support for @SerializedName in favor of @GsonAdapterKey
  • Deprecated @GsonAdapterKey. Note: this annotation will be removed in v2.1.0, so you are advised to use this release to move over completely to @UseStag. @GsonAdapterKey will currently take precedence over @SerializedName on fields annotated with both for backwards compatibility reasons.
  • Created KnownTypeAdapters and moved it to stag-library module so that it doesn't have to be generated at compile time. As a result, the stag-library module now has a hard dependency on gson:2.8.0. Previously, only the stag-library-compiler module depended on Gson, so it wouldn't interfere with the version you use locally. However, now gson:2.8.0 is required, unless you exclude it from the dependency.
  • Performance was improved, as much reflection as possible was removed.
  • Native support for enums, maps, and all primitive types supported by Gson.
  • Fields marked with the transient keyword will be excluded from parsing
  • Parsing errors on primitive types are no longer swallowed but are bubbled up.
  • Various bugfixes and edge cases handled
  • Please refer to the sample app and sample model in order to see all sorts of proper usage of the library.
  • Thanks to @anirudhramanan and @yasirmhd for doing the vast majority of the work on this release. Also thanks to @wilrnh for moving the build system over to TravisCI.

Version 1.2.1

22 Dec 15:35
Compare
Choose a tag to compare
  • Suppress unchecked assignment warnings in generated code, preventing build failure if unchecked warnings are set to error (thanks @mcumings)

Version 1.2.0

21 Dec 19:10
Compare
Choose a tag to compare
  • You can now specify the package name for generated Stag files (multiple module support)
  • Reduced number of generated methods by getting rid of individual adapter factories
  • Support for NonNull annotations on fields
    • @android.support.annotation.NonNull
    • @org.jetbrains.annotations.NotNull
    • @javax.annotation.Nonnull
    • @javax.validation.constraints.NotNull
    • @edu.umd.cs.findbugs.annotations.NonNull
    • @lombok.NonNull
    • @org.eclipse.jdt.annotation.NonNull
  • Added adapter caching for improved performance
  • No longer generate adapters for abstract classes
  • Fixed some problems with nested classes
  • Support Collection interface
  • Better performance for List, Map, and HashMap types
  • Support for Enums
  • Support for native arrays
  • Updated internal gson version to 2.8.0
  • Added more examples to the sample app
  • Thanks to @anirudhramanan and @yasirmhd for most of these improvements, and to @wilrnh for setting up the CI server

Version 1.1.2

18 Nov 20:43
Compare
Choose a tag to compare
  • Added support for float primitive type (thanks @anirudhramanan)
  • Support for all Map and List types (thanks @yasirmhd)
  • Fixed bug caused by an static inner model class being named the same as a model class in the same package (thanks @yasirmhd)
  • Better documented sample app