Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Plugin won't recognize @Named class #247

Copy link
Copy link

Description

@BartekGierej
Issue body actions

I was trying to implement this pattern from documentation:

Image

As for mapper itself, it is working fine and dandy. The plugin, however, seems to have problem with finding the annotated class which contains annotated mapping method. Error description is provided:

"Unknown @ Named reference 'TranslationMapper' ".

Reference for "TranslationsToString" is found properly.

@Mapper(uses = TranslationMapper.class)
public interface PrimaryClassMapper {
    @Mapping(source = "primary.id", target = "id")
    @Mapping(
            source = "primary.translatedNames",
            target = "name",
            qualifiedByName = {"TranslationMapper", "TranslationsToString"})
    SecondaryClass toSecondaryClass(PrimaryClass primary, @Context Language targetLanguage);
}
@Named("TranslationMapper")
public class TranslationMapper {
    @Named("TranslationsToString")
    public String resolveTranslatedText(
            List<TranslationDto> translations, @Context Language targetLanguage) {
        //some fancy logic
    }
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.