Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An IntelliJ IDEA plugin for working with MapStruct

License

NotificationsYou must be signed in to change notification settings

mapstruct/mapstruct-idea

Repository files navigation

An IntelliJ IDEA plugin for working with MapStruct

License

Build StatusCoverage Status

What is MapStruct?

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

To learn more about MapStruct have a look at themapstruct repository or thewebsite

Features

  • Code completions
    • Completion oftarget andsource properties in@Mapping annotation (nested properties also work)
    • Completion oftarget andsource properties in@ValueMapping annotation
    • Completion ofcomponentModel in@Mapper and@MapperConfig annotations
    • Completion ofqualifiedByName in@Mapping annotation
  • Go To Declaration for properties intarget andsource to setters / getters
  • Go To Declaration forMapping#qualifiedByName
  • Find usages of properties intarget andsource and find usages of setters / getters in@Mapping annotations
  • Highlighting properties intarget andsource
  • Errors and Quick fixes:
    • @Mapper or@MapperConfig annotation missing
    • Unmapped target properties with quick fixes: Add unmapped target property and Ignore unmapped target property.UsesunmappedTargetPolicy to determine the severity that should be used
    • Nosource defined in@Mapping annotation
    • More than onesource in@Mapping annotation defined with quick fixes: Removesource. Removeconstant. Removeexpression. Useconstant asdefaultValue. Useexpression asdefaultExpression.
    • More than one default source in@Mapping annotation defined with quick fixes: RemovedefaultValue. RemovedefaultExpression.
    • target mapped more than once by@Mapping annotations with quick fixes: Remove annotation and change target property.
    • * used as a source in@Mapping annotation with quick fixes: Replace* with method parameter name.
    • Unknown reference inspection forsource andtarget in@Mapping and@ValueMapping annotation.
    • Unknown reference inspection forqualifiedByName in@Mapping annotation

Requirements

The MapStruct plugin requires Java 11 or later

Building from Source

Since the project has been migrated to the Gradle and [Gradle IntelliJ plugin][gradle-intellij-plugin],the build process is much simpler. The only thing to build the plugin is to run:

./gradlew build

All required dependencies like Grammar-Kit, JFlex are downloaded in the background and triggered properlyduring the build process. You can also test the plugin easily with running:

./gradlew runIde

All of the gradle tasks can be connected to the IntelliJ debugger, so the development process is very easy.

Licensing

The MapStruct plugin is licensed under the Apache License, Version 2.0 (the "License"); you may not use it except in compliance with the License. You may obtain a copy of the License athttps://www.apache.org/licenses/LICENSE-2.0.

About

An IntelliJ IDEA plugin for working with MapStruct

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors10


[8]ページ先頭

©2009-2025 Movatter.jp