Skip to content

How to find out if a class has Jakarta Validation constraints within a byte-buddy plugin #1849

@jafarre-bi

Description

@jafarre-bi

Hello,

I want to write a byte-buddy plugin to weave in Jakarta Validation into my classes at build time.
The standard and recommended way to find out whether a class contains validation constraints starts with:
Validation.buildDefaultValidatorFactory().getValidator().getConstraintsForClass(Class)
But the plugin only provides a TypeDescription, from which it appears there is no way to obtain the Class.
Can I achieve what I need?

Thanks.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions