-
-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Milestone
Description
Consider the following code:
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
class Target {
public String value;
}
class Source {
}
@Mapper
abstract class SourceToScratchMapper {
@Mapping(target = "value", expression = "java(new Source().toString())")
public abstract Target map(Source source);
}In this case, code inside expression parameter is treated as a plain string, i.e. no code highlighting and no navigation assistance. However, if we add a setter to the Target class -
class Target {
public String value;
public void setValue(String value) {
this.value = value;
}
}...leaving mapper and source the same, the language is injected correctly - code inside java(...) is treated as Java fragment.
Metadata
Metadata
Assignees
Labels
No labels