From: SourceForge.net <no...@so...> - 2007-02-14 05:58:41
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4157046 By: akuns So I am at it again this time making some changes how plugins should be developed. I am updating all (not so many today) plugins to fit the model, so far it is just cosmetic/refactor. One change I am thinking of is how commands are processed, especially the argument processing methods public void init_command() -- set some of the fields for documentation public void add_command_arguments( Options options ) -- add your arguments public boolean process_command_option ( Option o ) throws IllegalArgumentException ** if argument is invalid throw exception new IllegalArgumentException ( formatArgumentError( getClass().getName(), "message", value ) ); ** if you are STRICT and the argument is not one of yours return false public boolean process_command_arguments( String[] argv ) throws IllegalArgumentException -- process any remaining arguments ** if argument is invalid throw exception new IllegalArgumentException ( formatArgumentError( getClass().getName(), "message", value ) ); ** if you are STRICT and the argument is not one of yours return false public void validate_command_arguments () throw IllegalArgumentException -- validate all required arguments and settings are correct ** if argument is invalid throw exception new IllegalArgumentException ( formatArgumentError( getClass().getName(), "message", value ) ); I would like to simplify the 'execute_check()' method as well, but I have not touched this yet. thinking... public void execute_check () .. and you must do a 'super.complete( message, state )' within execute check. ** thoughts? I doced the whole thing - http://blue.sourceforge.net/wiki/developing_plugins ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=545812 |