You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if OWNER supports the possibility to declare an option as required, maybe with an annotation called @required. If no value was assigned to such an option, OWNER should throw an exception and gives the possibility to write a nice overview of options that are required to a given OutputStream.
What do you think?
The text was updated successfully, but these errors were encountered:
Thanks for your suggestions. This enhancement is planned for next versions.
With version 1.5.0 you can register a listener for the required property and throw a RollbackOperationException or a RollbackBatchException when the new value is null or invalid. Please have a look at event support feature.
In the next release I want to implement an annotation based validation like the one you are suggesting, but it needs to be carefully designed.
I will add a method like addRollbackListener() which allows the user to intercept when a listner threw a rollback, so that the user may decide to do some logging or whatever.
A flexible and customizable validation mechanism is already planned, which should allow more control over properties values, than just check if a value is not specified.
Instead, I am not planning to show a "help" on an outputstream to specify which properties are mandatory or not, since this can be seen in the source code, or should be documented in the user manual or documentation of the application. Another option is to use "javap" utility to see the signature of the object ("javap -v className") which in Java7 it displays the class signature with the annotation; I agree that the output is not very readable.
BTW I will consider this "documentation" feature, maybe for a utility class. It would be nice to replace the default save mechanism allowing the user to include javadocs and annotations in the generated properties files, so that when the user modifies the configuration file, he can see some explanation text for every setting.
It would be nice if OWNER supports the possibility to declare an option as required, maybe with an annotation called @required. If no value was assigned to such an option, OWNER should throw an exception and gives the possibility to write a nice overview of options that are required to a given OutputStream.
What do you think?
The text was updated successfully, but these errors were encountered: