Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1011 exclude other mappings (name and parameter base) from nesting
- Loading branch information
sjaakd
committed
Jan 24, 2017
1 parent
f1d9e22
commit 1819e6d
Showing
11 changed files
with
362 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/FishTankMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) | ||
* and/or other contributors as indicated by the @authors tag. See the | ||
* copyright.txt file in the distribution for a full listing of all | ||
* contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mapstruct.ap.test.nestedtargetproperties; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.ap.test.nestedtargetproperties._target.FishTankDto; | ||
import org.mapstruct.ap.test.nestedtargetproperties.source.FishTank; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
@Mapper | ||
public interface FishTankMapper { | ||
|
||
FishTankMapper INSTANCE = Mappers.getMapper( FishTankMapper.class ); | ||
|
||
@Mapping(target = "fish.kind", source = "fish.type") | ||
FishTankDto map( FishTank source ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) | ||
* and/or other contributors as indicated by the @authors tag. See the | ||
* copyright.txt file in the distribution for a full listing of all | ||
* contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mapstruct.ap.test.nestedtargetproperties._target; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class FishDto { | ||
|
||
private String kind; | ||
|
||
// make sure that mapping on name does not happen based on name mapping | ||
private String name; | ||
|
||
public String getKind() { | ||
return kind; | ||
} | ||
|
||
public void setKind(String kind) { | ||
this.kind = kind; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...essor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/FishTankDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) | ||
* and/or other contributors as indicated by the @authors tag. See the | ||
* copyright.txt file in the distribution for a full listing of all | ||
* contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mapstruct.ap.test.nestedtargetproperties._target; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class FishTankDto { | ||
|
||
private FishDto fish; | ||
private WaterPlantDto plant; | ||
|
||
public FishDto getFish() { | ||
return fish; | ||
} | ||
|
||
public void setFish(FishDto fish) { | ||
this.fish = fish; | ||
} | ||
|
||
public WaterPlantDto getPlant() { | ||
return plant; | ||
} | ||
|
||
public void setPlant(WaterPlantDto plant) { | ||
this.plant = plant; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...sor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/_target/WaterPlantDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) | ||
* and/or other contributors as indicated by the @authors tag. See the | ||
* copyright.txt file in the distribution for a full listing of all | ||
* contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mapstruct.ap.test.nestedtargetproperties._target; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class WaterPlantDto { | ||
|
||
private String kind; | ||
|
||
public String getKind() { | ||
return kind; | ||
} | ||
|
||
public void setKind(String kind) { | ||
this.kind = kind; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/Fish.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Copyright 2012-2017 Gunnar Morling (http://www.gunnarmorling.de/) | ||
* and/or other contributors as indicated by the @authors tag. See the | ||
* copyright.txt file in the distribution for a full listing of all | ||
* contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.mapstruct.ap.test.nestedtargetproperties.source; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class Fish { | ||
|
||
private String type; | ||
private String name; | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
} |
Oops, something went wrong.