Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1011 reproducer, not stopping name based mapping
- Loading branch information
sjaakd
committed
Jan 28, 2017
1 parent
280a438
commit 23fd42a
Showing
8 changed files
with
344 additions
and
1 deletion.
There are no files selected for viewing
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; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
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,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.source; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class Fish { | ||
|
||
private String type; | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public void setType(String type) { | ||
this.type = type; | ||
} | ||
|
||
} |
55 changes: 55 additions & 0 deletions
55
processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/FishTank.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,55 @@ | ||
/** | ||
* 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 FishTank { | ||
|
||
private Fish fish; | ||
private WaterPlant plant; | ||
private String name; | ||
|
||
public Fish getFish() { | ||
return fish; | ||
} | ||
|
||
public void setFish(Fish fish) { | ||
this.fish = fish; | ||
} | ||
|
||
public WaterPlant getPlant() { | ||
return plant; | ||
} | ||
|
||
public void setPlant(WaterPlant plant) { | ||
this.plant = plant; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
processor/src/test/java/org/mapstruct/ap/test/nestedtargetproperties/source/WaterPlant.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.source; | ||
|
||
/** | ||
* | ||
* @author Sjaak Derksen | ||
*/ | ||
public class WaterPlant { | ||
|
||
private String kind; | ||
|
||
public String getKind() { | ||
return kind; | ||
} | ||
|
||
public void setKind(String kind) { | ||
this.kind = kind; | ||
} | ||
|
||
} |