MapStruct Support

Compatible with: IntelliJ IDEA MPS Android Studio
Feb 10, 2019
21 392
MapStruct support for IntelliJ IDEA

Website | GitHub | Issue Tracker |

This plugin gives some assistence in projects that use MapStruct to generate bean mapping code.

MapStruct is a Java annotation processor for the generation of type-safe and performant mappers for Java bean classes.

If you want to discuss specific topics, then ping me (@filiphr) in the MapStruct users chat room on gitter.
Features:
  • Code Completion:
    • Completion of target and source properties in @Mapping annotation (nested properties also work)
    • Completion of target and source properties in @ValueMapping annotation
    • Completion of componentModel in @Mapper and @MapperConfig annotations
  • Go To Declaration for properties in target and source to setters / getters
  • Find usages of properties in target and source and find usages of setters / getters in @Mapping annotations
  • Highlighting properties in target and source
  • Refactoring support for properties and methods renaming
  • Errors and Quick fixesL
    • @Mapper or @MapperConfig annotation missing
    • Unmapped target properties with quick fixes: Add unmapped target property and Ignore unmapped target property. NB: unmappedTargetPolicy is not yet considered

Recent change notes

1.1.0

  • Support for types with Builders and fluent setters
  • Added errors and quick fixes:
    • @Mapper or @MapperConfig annotation missing
    • Unmapped target properties and quick fixes for it: Add unmapped property or Ignore unmapped property. NB: unmappedTargetPolicy is not yet considered

1.0.1

  • Bug fix: Properly handle methods with less than 3 characters

1.0.0

  • Initial version
  • Code completion for target and source in @Mapping and @ValueMapping
  • Code completion for componentModel in @Mapper and @MapperConfig
  • Go To Declaration for properties in target and source to setters / getters
  • Find usages of properties in target and source and find usages of setters / getters in @Mapping annotations
  • Highlighting properties in target and source
  • Refactoring support for properties and methods renaming

General usage instructions

Install and get support for auto completion in MapStruct annotations