Filip Hrisafov
2b2299a730
#73 Add support for using constructor arguments when instantiating mapping targets
...
By default the constructor argument names are used to extract the target properties.
If a constructor is annotated with an annotation named `@ConstructorProperties` (from any package) then it would be used to extract the target properties.
If a mapping target has a parameterless empty constructor it would be used to instantiate the target.
When there are multiple constructors then an annotation named `@Default` (from any package) can be used to mark a constructor that should be used by default when instantiating the target.
Supports mapping into Java 14 Records and Kotlin data classes out of the box
2020-04-26 12:44:41 +02:00
Filip Hrisafov
d6ff5204d7
Accessor#getSimpleName should return a String
2020-04-26 12:44:41 +02:00
Sjaak Derksen
7c62aec281
#2077 nullpointer due to no-getter source ( #2078 )
2020-04-25 17:01:22 +02:00
Filip Hrisafov
3bffe96983
#1159 : Do not fail loading AnnotationProcessorContext if loading AstModifyingAnnotationProcessor fails
2020-04-13 17:40:47 +02:00
Filip Hrisafov
c58f80cc5f
#2069 Refactor target reference to report errors during bean mapping instead of creation of the target reference
...
With this we can more easily go in the direction of using constructor to map into target beans.
2020-04-13 13:20:09 +02:00
Filip Hrisafov
1bbc4e1ca8
Use expected.getMessageRegex when no message for the Diagnostic descriptor has been defined
2020-04-12 12:26:07 +02:00
Filip Hrisafov
6797afb647
Use exact message for Diagnostic test messages assertions
2020-04-12 09:55:44 +02:00
Filip Hrisafov
a845197b0b
#2056 : Handle null TypeMirror in uses and import gracefully
...
Due to a bug in javac (JDK-8229535) for an annotation with Class values, instead of returning a TypeMirror with TypeKind#ERROR the compiler returns the string "<error>". Eclipse doesn't have this problem currently.
2020-04-10 11:20:20 +02:00
Filip Hrisafov
c410379f83
#1553 : Update tycho-compiler-jdt to latest 1.6.0 version
...
Disable one test in GenericsHierarchyTest for Eclipse on Java 8 due to a bug in the Tycho compiler.
Disable freeBuilder integration test for Eclipse since there are some problems in the second round of annotation processing (no ModelElementProcessor(s) are found)
2020-04-10 09:33:09 +02:00
Filip Hrisafov
853ff7f74f
#2060 : MapStruct should work properly on the module path
2020-04-05 16:37:51 +02:00
Filip Hrisafov
4f76208c62
#2021 Generate compilable code when Decorator is nested within the Mapper
...
We need to treat the import of the decoratorType specially when it is nested.
Calling addIfImportRequired is not the most correct approach since it would
lead to checking if the type is to be imported and that would be false
since the Decorator is a nested class within the Mapper.
However, when generating the Decorator this is not needed, because the Decorator is a top level class itself
In a nutshell creating the Decorator should have its own ProcessorContext, but it doesn't
2020-04-05 14:09:23 +02:00
Filip Hrisafov
b7d5e557c1
Checkstyle max line length should be 120
2020-04-05 09:29:00 +02:00
Pawel Radzinski
bbd68baf64
Update chapter-10-advanced-mapping-options.asciidoc ( #2050 )
...
Correct some typos and punctuation here and there.
2020-03-30 21:11:07 +02:00
Filip Hrisafov
f8a3924005
Use fix version for maven-processor-plugin
...
Using the latest (4.0-beta1) does not work on Java 8 since it is compiled with Java 9
2020-03-07 16:44:19 +01:00
Filip Hrisafov
63c2edd333
Reset locale and time zone in every test
2020-03-07 16:44:19 +01:00
Filip Hrisafov
551c104295
#2019 Setup GitHub Actions
...
Add Maven Wrapper for using in GitHub Actions
Remove Travis
2020-03-07 16:44:19 +01:00
Filip Hrisafov
fe91c6d523
Disable Checkstyle for Target for #2018 test
2020-02-23 19:06:46 +01:00
Filip Hrisafov
b9f86fe6ac
#2018 Add test case with properties with underscore verifying that it is working as expected
2020-02-23 17:33:32 +01:00
Filip Hrisafov
f5771c4177
#2014 Add support for mapping from Java 14 records
2020-02-23 13:34:08 +01:00
Sean C. Sullivan
273487f152
maven-compiler-plugin 3.8.1
2020-02-18 07:16:31 +01:00
Tim J. Baumann
a6b3cc364a
Fix Javadoc of resolveViaMethodAndConversion
...
and fix some smaller Javadoc typos.
2020-02-07 17:38:59 +01:00
Robin Clarke
015468b461
Updated versions on readme.md to 1.3.1.Final
2020-02-07 17:37:06 +01:00
Filip Hrisafov
c64e03468e
Fix Checkstyle error
2020-02-07 17:35:51 +01:00
Filip Hrisafov
f382903bc6
Add proper attribution for the code for generating the sourceTargetVersion for other JRE
2020-02-04 13:05:53 +01:00
Filip Hrisafov
02a113b2d4
#1308 Switch to JUnit Jupiter and do not use Toolchains for the integration tests ( #2013 )
...
The CI should be setup to run on different Java versions, for which the integration tests are going to be run
2020-02-03 21:56:48 +01:00
Filip Hrisafov
95ceba1a1e
#2016 Update Checkstyle to 8.29
...
Adapt checkstyle configuration with new changes:
* Move cacheFile to Checker module
* Move LineLength to Checker module
* Use SuppressWithPlainTextCommentFilter
2020-02-02 14:33:45 +01:00
Sjaak Derksen
58da2d293f
#695 user control over mapping means (direct, method, conversion, 2step)
2020-02-02 10:05:26 +01:00
Sjaak Derksen
2d3761051a
#2011 Introduce gem as replacement of hickory:prism ( #2007 )
2020-01-27 20:16:04 +01:00
sjaakd
6b49c838eb
#1998 simplify usage of inheritance of annotation fields
2020-01-25 09:13:50 +01:00
sjaakd
b84526b24a
#1998 preparation move classes to new names 2
2020-01-25 09:13:50 +01:00
sjaakd
2b36c220a3
#1998 preparation move classes to new names 1
2020-01-25 09:13:50 +01:00
Filip Hrisafov
d056570267
#2001 Avoid NPE when checking whether import type element is nested
...
When the typeToAdd is an array then TypeElement is null and ComponentType is the one that would be imported
2020-01-24 22:02:51 +01:00
Marcel Overdijk
327730127b
Updated docs to add compilerArgs instead of replacing them.
...
When configuring MapStruct compilerArgs *add* them, no *replace*
2020-01-24 21:59:46 +01:00
Sjaak Derksen
076f3ba839
#1995 follow up, small typo
2020-01-10 20:16:25 +01:00
Sjaak Derksen
57cfd35afc
#1995 and mapstruct/mapstruct.org#101 nesting calling custom method ( #1999 )
...
Co-authored-by: coffman21 <fire2low@gmail.com>
2020-01-09 20:59:36 +01:00
Sjaak Derksen
c153c8bf5a
#1983 javadoc and doc on @ignore in @InheritInverseConfituration ( #1986 )
2019-12-23 20:41:38 +01:00
fml2
84062bf78f
docs: Fix typo in the builder section
2019-12-09 21:01:19 +01:00
ttzn
779eb1bd47
#1420 Add support for Gradle incremental annotation processing ( #1971 )
...
* Add relevant file in META-INF
* Add integration test with Gradle test kit dependencies
* Test with Gradle 5 and Gradle 6
2019-12-08 19:55:16 +01:00
Sjaak Derksen
ee794d042c
#807 meta annotations and duck typing ( #1979 )
2019-12-07 22:20:11 +01:00
Sjaak Derksen
071e5dc6b2
#1966 extra unit test ( #1967 )
2019-11-10 20:14:33 +01:00
Andrei Arlou
b26cd4e0cb
#1953 Fix TODO items for: integrationtest-java8Test, integrationtest-lombokBuilderTest, processor-nullvaluemappingTest ( #1955 )
2019-10-26 22:24:59 +03:00
Andrei Arlou
efea2fb662
#1951 Use Map.computeIfAbsent in NestedTargetPropertyMappingHolder ( #1952 )
2019-10-20 22:11:17 +03:00
Andrei Arlou
74a2e358e8
#1946 Simplify conditions in classes: Parameter, SelectionParameters, MethodReference, PropertyMapping
2019-10-20 21:01:58 +02:00
Andrei Arlou
e8a7832d5b
#1948 Fix minor warnings with using collection in package model and class util/workarounds/EclipseAsMemberOfWorkaround ( #1949 )
2019-10-20 14:16:26 +03:00
Andrei Arlou
fe37b01c65
#1944 Remove unused constants in JavaStreamConstants ( #1945 )
2019-10-20 14:13:38 +03:00
Sjaak Derksen
5fbc86d92f
#1788 allowing enum / not enum by removing checks ( #1939 )
2019-10-08 21:06:47 +02:00
Sjaak Derksen
507ec1b384
#1557 & #1936 String-to-enum and enum-to-String ( #1938 )
...
* #1557 making enum-to-string and string-to-enum
* #1936 <ANY_REMAINING> and <ANY_UNMAPPED> not ignored when inverting
2019-10-07 20:30:20 +02:00
Filip Hrisafov
44ae27d7ca
#1881 Use ReportingPolicy#IGNORE for unmappedSourcePolicy when mapping references are for forged methods
...
This aligns with the way the ReportingPolicy is handled for unmappedTargetPolicy when mapping references are for forged methods
2019-10-06 21:05:25 +02:00
Sjaak Derksen
1cb8291fb9
#1933 ignoreByDefault not inherited from config ( #1935 )
2019-10-05 15:47:25 +02:00
Filip Hrisafov
b3023b3902
#1828 Use update method when nested property of target is populated with multiple nested properties of source ( #1931 )
2019-09-29 17:21:20 +02:00