It should be possible to configure library with Java's buildin service loader. It will be more convinient for users as toString is mostly done in domain layer where users don't want to use any frameworks, and domain objects are POJOs created with new.