jesterj
jesterj copied to clipboard
Interface for the processor Builder classes, input validation
The common functionality to refactor into the interface could be
- the 'build' method
- maybe handle getObj / setObj in a unified way
- a 'validate' method to validate the processor inputs, which perhaps throws a ConfigurationException
We do have a Builder interface though it's not presently being used. It needs to loose it's generics (because that gets complicated with inheritance). I can see adding a validate method. It would be nice to have something for my use of getObj/setObj except it's not possible to specify non-public methods in interfaces and those need to remain protected/private
might it be ok to do something with the 'obj' via a default method on that interface; may lose some encapsulation but saves on that method impl
This must be work in progress. I see that there's now the 'isValid' method on NamedBuilder, presumably for subclasses to override and do their validation. However, nothing seems to be calling this method. And, it returns a boolean which begs the question of how a validation error is to be propagated into the calling layers.
The present incarnation of the NamedBuilder class has some methods that were originally intended to support a builder<-->YAML conversion. This is presently a mothballed idea. Perhaps it will return, but not for 0.2
This has become out dated