Skip to content

Document <THROW_EXCEPTION> in the reference guide #3112

@mjustin

Description

@mjustin

Expected behavior

MappingConstants.THROW_EXCEPTION ("<THROW_EXCEPTION>") allows throwing an exception for particular value mappings. For instance:

        @ValueMapping(target = "APPLE", source = "Apple")
        @ValueMapping(target = "BANANA", source = "Banana")
        @ValueMapping(target = MappingConstants.THROW_EXCEPTION, source = MappingConstants.ANY_UNMAPPED)
        Fruit mapFruit(String fruit);

However, this constant is not referenced in the MapStruct reference guide.

Actual behavior

I would expect to see this explained in the reference guide. In my particular use case, I didn't see any references in the Mapping enum to enum types section.

Steps to reproduce the problem

Open the reference guide. Notice that there are no references to either <THROW_EXCEPTION> or MappingConstants.THROW_EXCEPTION.

MapStruct Version

MapStruct 1.5.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions