Skip to content

Recursive Mapping (one level) #134

@sjaakd

Description

@sjaakd

MapStruct should be able to map A to C if it knows how to

  1. map 'A' to 'B'
  2. map 'B' to 'C'

Example (see also #119).
a) 'A' is JAXBElement<Source>
b) 'B' is Source
c) 'C' is Target

Then the new build-in method below would make mapping 1):

    public <T> T convert( JAXBElement<T> t ) {
        return t.isNil() ? null : t.getValue();
    }

And a user Mapper method

@Mapper
public interface  SourceTargetMapper {

    Target sourceToTarget(Source source);
}

Would make mapping 2).

However, MapStruct can currently not make the complete mapping automatically.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions