229 Commits

Author SHA1 Message Date
Tomas Poledny
4223e3ab81 #2255 Add constants for componentModel 2021-01-17 15:13:42 +01:00
Filip Hrisafov
f84f756a4c #2293 Use MapperConfig instead of MappingConfig in the documentation 2021-01-01 21:29:48 +01:00
Michael Düsterhus
e73dd1b485 Update chapter-2-set-up.asciidoc
See official maven doc on this: https://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html
Otherwise for example intellij doesn't recognize the compiler options on maven import
2020-12-15 19:32:19 +01:00
Nikolas Charalambidis
6daea86a1b
Add Lombok subsection in the documentation (#2266) 2020-11-11 22:28:53 +01:00
Nikolas Charalambidis
8f9df5b69b
#2258 Fixes vague description of @Default and @ConstructorProperties annotations 2020-11-04 21:39:06 +01:00
Saheb Preet Singh
26f62b7ef0 #607 Mapping Iterable<?> object to an object instead of collection 2020-10-21 21:20:46 +02:00
Filip Hrisafov
58dbaee472 [maven-release-plugin] prepare for next development iteration 2020-10-11 09:35:30 +02:00
Filip Hrisafov
d8f22f8311 [maven-release-plugin] prepare release 1.4.1.Final 2020-10-11 09:35:30 +02:00
Jasper Vandemalle
4480e0f367 Fix minor typos 2020-10-03 00:35:28 +02:00
Filip Hrisafov
eb5b8bb71e [maven-release-plugin] prepare for next development iteration 2020-09-26 10:20:47 +02:00
Filip Hrisafov
9973b92ccb [maven-release-plugin] prepare release 1.4.0.Final 2020-09-26 10:20:45 +02:00
Filip Hrisafov
8b22654abd [maven-release-plugin] prepare for next development iteration 2020-08-30 16:31:45 +02:00
Filip Hrisafov
c962962546 [maven-release-plugin] prepare release 1.4.0.CR1 2020-08-30 16:31:44 +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
Makoto Oda
99a1fd609c
Documentation: typo? (#2186) 2020-08-25 20:38:19 +02:00
Makoto Oda
18a5f1bdc0
Documentation: Extra phrase inserted? (#2187) 2020-08-25 20:37:02 +02:00
Makoto Oda
e6279d10c7
Is 'r' missing? (#2188) 2020-08-25 20:34:02 +02:00
Filip Hrisafov
ef4bfc9aad [maven-release-plugin] prepare for next development iteration 2020-07-19 18:10:13 +02:00
Filip Hrisafov
1d223284c2 [maven-release-plugin] prepare release 1.4.0.Beta3 2020-07-19 18:10:12 +02:00
Filip Hrisafov
cb432fa61b
#2150 Change the rules for how a constructor for mapping is picked
New rules:

1. Constructor annotated with @Default (from any package) has highest precedence
2. If there is a single public constructor then it would be used to construct the object
3. If a parameterless constructor exists then it would be used to construct the object, and the other constructors will be ignored
2020-07-18 18:53:32 +02:00
Filip Hrisafov
2fede3583d [maven-release-plugin] prepare for next development iteration 2020-07-18 01:12:05 +02:00
Filip Hrisafov
fc4f65ddb6 [maven-release-plugin] prepare release 1.4.0.Beta2 2020-07-05 23:11:41 +02:00
SahinSarkar
13df6a21bc Fixed typo in documentation 2020-07-04 16:55:24 +02:00
Filip Hrisafov
d87d75a7a8 [maven-release-plugin] prepare for next development iteration 2020-06-01 13:42:32 +02:00
Filip Hrisafov
72ce5f3bd2 [maven-release-plugin] prepare release 1.4.0.Beta1 2020-06-01 13:42:32 +02:00
Filip Hrisafov
fc5e1ffe6b Upgrade to latest 1.6.2 asciidoc and fix incorrect closing documentation tag 2020-05-30 15:34:54 +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
7b5a54971f
Add EnumTransformationStrategy SPI (#2089)
Add a new custom EnumTransformationStrategy SPI which can be used for providing custom way of name based mapping for enums.

Add 4 out of the box transformation strategies:

* prefix - add a prefix to the name based enum mapping
* stripPrefix - remove a prefix from the name based enum mapping
* suffix - add a suffix to the name based enum mapping
* stripSuffix - remove a suffix from the name based enum mapping

This can be achieved by using the new `EnumMapping`

e.g.

Add suffix `_TYPE` to all enums:

`@EnumMapping(nameTransformationStrategy = "suffix", configuration = "_TYPE")`

With this it would be possible to achieve what is needed in #796, #1220, #1789.
2020-05-18 07:17:30 +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
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
Sean C. Sullivan
273487f152 maven-compiler-plugin 3.8.1 2020-02-18 07:16:31 +01:00
Sjaak Derksen
58da2d293f
#695 user control over mapping means (direct, method, conversion, 2step) 2020-02-02 10:05:26 +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
Sjaak Derksen
ee794d042c
#807 meta annotations and duck typing (#1979) 2019-12-07 22:20:11 +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
0d23f09e37
#1918 multiple target this mappings (#1920) 2019-09-23 20:04:56 +02:00
Dainius Figoras
88a8669642 #1406 targeting . as current object 2019-09-22 19:08:05 +02:00
Andrei Arlou
f4c9313972
#1791 Support for conversion between java.time.LocalDateTime and javax.xml.datatype.XMLGregorianCalendar (#1894) 2019-09-21 22:27:45 +03:00
Andrei Arlou
750ce48023 #1792 Annotation processor option for default injection strategy 2019-09-18 19:51:36 +02:00
Andrei Arlou
447bb00f89
#1773 Update documentation: componentModel=jsr330 with @DecoratedWith not longer experimental (#1907) 2019-09-18 07:18:05 +03:00
Andrei Arlou
ba90c95f23 #991 Split reference guide source into an adoc file per chapter 2019-08-24 20:51:16 +03:00
Sjaak Derksen
66e57b0dfe
#1862 Update @MappingTarget documentation to take builders (#1864) 2019-08-13 18:44:49 +02:00
Matt Drees
9c33199a66 Improve terms in qualifier docs (#1814)
This sentence is talking about `@Target`, not `@Retention`.
Also, let's use 'type' instead of 'class' to line up with `ElementType.TYPE`.
2019-05-25 11:34:30 +02:00
Sjaak Derksen
33710584d3
#1742 & #1661 refactoring and making builder optional (#1811) 2019-05-24 23:30:16 +02:00
Sjaak Derksen
648ebceb30
#1819 documentation clarification on obtaining Mapper (#1820) 2019-05-16 22:23:37 +02:00
Sjaak Derksen
871353fccb
#1784 NullValueMappingStrategy.RETURN_DEFAULT refers wrongly to primitive types (#1785) 2019-04-07 21:38:22 +02:00