Filip Hrisafov
6102d0cc8e
#2236 Different nested target mappings should generate different intermediate methods
...
Make sure that MappingReferences are taken into consideration when comparing whether 2 mapping methods are equal.
This makes sure that when using nested target mappings that have the same property mappings, but different mappings 2 distinct methods will be created
2020-10-18 22:31:08 +02:00
Filip Hrisafov
823b5edd9f
#2213 : primitive arrays should be directly mapped (we are cloning them anyways)
...
Additionally fix problem when annotations `ElementType.TYPE_USE` not handled correctly for javac
2020-10-03 16:54:01 +02:00
Filip Hrisafov
52ab22bbd8
#2197 Strip leading underscores and digits when sanitizing identifier name
2020-09-20 09:46:41 +02:00
Filip Hrisafov
7dcbef349d
#2169 Add support for defining a custom unexpected value mapping exception
...
Expose definition via:
* `@EnumMapping`
* `@Mapper`
* `@MapperConfig`
* `EnumMappingStrategy` SPI
Rename `EnumNamingStrategy` to `EnumMappingStrategy`
2020-08-29 13:53:30 +02:00
Filip Hrisafov
6aa39ff428
#2142 : Strip leading underscore when sanitizing identifier name
2020-07-18 11:35:25 +02:00
Filip Hrisafov
da37d40152
#2109 Generate correct array assignment for constructor parameter mapping
2020-06-07 16:45:32 +02:00
Filip Hrisafov
c23592a7fe
Add EnumNamingStrategy SPI ( #2100 )
...
Add a new EnumNamingStrategy SPI which can be used for customising the way enums are matched by name.
It is similar to the AccessorNamingStrategy such that it allows implementors to provide a custom way of defining a property.
Related to #796 , #1220 , #1789 and #1667
2020-05-25 21:31:29 +02:00
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
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
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
Sjaak Derksen
7bee12138d
#1307 & #1845 remove deprecated enummapping & create ST - refs under bean mapping
...
#1307 remove deprecated enum mapping
#1845 create source / target references under bean mapping
2019-07-18 07:20:22 +02:00
Sjaak Derksen
3c079e412a
#1707 fix for not defining local variable in stream-iterable mapping ( #1708 )
2019-02-10 10:31:51 +01:00
Sjaak Derksen
07c7a29adc
#1700 Optimizing code for adders and stream adders ( #1701 )
2019-01-29 20:02:23 +01:00
Sjaak Derksen
0981959ff0
#1699 add sensible defaults to NullValuePropertyMapping.SET_TO_DEFAULT ( #1702 )
2019-01-28 22:47:37 +01:00
Sjaak Derksen
57caee250f
#1685 completing nullvaluepropertymappingstrategy ( #1697 )
2019-01-27 21:09:44 +01:00
Sjaak Derksen
cf668bea77
#1576 Delay determining whether a Type needs to be imported & java.time cleanup ( #1642 )
2018-11-06 07:36:09 +00:00
Filip Hrisafov
de13634cce
#1478 Use source property name for the adder iterator
2018-10-28 14:55:41 +01:00
Sjaak Derksen
288813fc3c
#1306 Add new NullValuePropertyMappingStrategy which leaves @MappingTarget untouched ( #1618 )
2018-10-25 22:14:26 +01:00
MapStruct Team
b35126e609
#1411 Update copyright header on all files
...
* Use new shorter copyright header without a year
* Use SLASHSTAR_STYLE for Java files
2018-07-15 19:29:28 +02:00
Filip Hrisafov
771debee88
#1453 Make sure that we always forge iterable / map mapping methods without bounds
...
When generating collection / map mapping methods make sure that the method result type is without bounds
2018-05-06 22:03:16 +02:00
sjaakd
45cc87849b
#1458 reporting error detail from literal assignment
2018-05-05 22:56:00 +02:00
sjaakd
d92b439a60
#1462 define constants as JLS literal types, enforce long L suffix
2018-04-29 09:12:49 +02:00
Kevin Grüneberg
499dbd4561
#1273 Fix for NullValueMappingStrategy#RETURN_DEFAULT when using collections
...
When mapping a collection using NullValueMappingStrategy#RETURN_DEFAULT and the source is null, the target will be an empty collection.
2017-09-17 23:03:24 +02:00
Filip Hrisafov
6187a72a2b
#1148 Always add the generated MappingMethod if the MappingOptions are restricted to the defined mappings
2017-05-24 22:32:05 +02:00
Filip Hrisafov
15133d5a0f
#777 Set initial capacity for new collection / map element in collection / map mappings
2017-05-06 15:04:42 +02:00
Filip Hrisafov
763deaa917
#1164 Split the SetterWrapperForCollections into multiple models:
...
* SetterWrapperForCollectionsAndMaps - Does a simple assignment without doing any null checks
* SetterWrapperForCollectionsAndMapsWithNullCheck - Does an assignment that does a null check before assignment and takes direct assignment into consideration
* ExistingInstanceSetterWrapperForCollectionsAndMaps - Used for wrapping an assignment when the method is an update method
Additionally don't do local var assignment if there are presence checkers
2017-04-25 22:41:51 +02:00
navpil
fc8ded0dec
#1103 Fix issue with recursive mapping throwing a StackOverflow
2017-03-16 20:00:05 +01:00
Filip Hrisafov
9881a8803c
#1104 use unmapped target policy for forged name based mappings
2017-03-15 22:04:58 +01:00
Filip Hrisafov
d4c6250944
#1102 Add support for Auto forging of Enum properties
2017-03-12 15:34:46 +01:00
Filip Hrisafov
10aeb444f5
#1091 Map ANY_REMAINING Enum source to null
2017-02-21 20:43:19 +01:00
Filip Hrisafov
3192345e33
#1057 Add source fixtures for tests
2017-02-20 00:19:31 +01:00
sjaakd
bdbee40dcf
#1057 Add reproducer tests
2017-02-20 00:19:31 +01:00
Filip Hrisafov
8dbcc43a8e
#1082 Do not generate an empty line after method start for NestedPropertyMappingMethod
2017-02-19 16:13:00 +01:00
Filip Hrisafov
9899504db9
#1073 Change NestedPropertyMappingMethod to not use name in its equality, but to use the Safe Properties
2017-02-19 11:50:52 +01:00
Filip Hrisafov
40fc5612cb
#1060 Use update methods if there are multiple source parameters
2017-02-10 19:57:41 +01:00
Andreas Gudian
48d7963cca
Merge branch '1.1-master'
2017-01-05 22:04:29 +01:00
Andreas Gudian
22b28f58db
Merge branch '1.1-master'
2017-01-05 21:11:10 +01:00
Andreas Gudian
b02f8e5df5
#1032 Update license headers to 2017
2017-01-05 18:55:26 +01:00
Filip Hrisafov
ec6913618e
#1007 Add additional generated code tests
2017-01-04 09:32:02 +01:00
Filip Hrisafov
8654d8f45a
#1007 add base for comparing generated code to a fixed baseline
2016-12-30 19:03:45 +01:00
Andreas Gudian
050c398da6
#966 Avoid missing newlines between methods and multiple newlines (generally) by adding a checkstyle rule, fixing current incarnations.
2016-12-01 21:52:58 +01:00
Andreas Gudian
71f4a4b2ca
#626 Remove blank lines before closing brackets
2015-08-17 23:02:16 +02:00
Andreas Gudian
2c2f69b0d3
#626 Remove doubled blank lines on Windows
2015-08-17 22:10:44 +02:00
Andreas Gudian
4a2f0c01ec
#544 run some checkstyle rules on sources generated by our tests
2015-05-17 23:16:14 +02:00