Error Handler With
interface ErrorHandlerWith
Interface for handling null or blank field values during configuration loading.
This interface is intended to be used with the net.ririfa.yacla.annotation.IfNullEvenRequired annotation to provide custom logic when a required field is found to be null or blank.
The handle method is invoked during validation or loading, allowing the handler to log, throw, mutate state, or even silently recover from the missing value.
Example:
class PanicIfNull : ErrorHandlerWith {
override fun handle(fieldValue: Any?) {
throw IllegalStateException("Field was unexpectedly null: $fieldValue")
}
}Content copied to clipboard