Returns the "default" values for the arguments of this class.
Returns the "default" values for the arguments of this class. Unrelated to the current value of those arguments. Unless overridden, "default" means whatever values are assigned by the no-arg constructor of this class.
get back the current (name, value) of all arguments as strings.
get back the current (name, value) of all arguments as strings. This does not just return the original arguments that were passed to this function -- they may have been changed from defaulting, validation, etc.
In general, users will not need this function, but it is useful for tools built on top, eg. saving to a property file
Read config from an external source, and use that to modify the set of arguments.
Read config from an external source, and use that to modify the set of arguments. The "original" arguments are given as an argument to this function, so that this method can base its behavior on those arguments. (Eg., it can take a filename from those args.) It should return the complete set of args that should be used. It is free to choose to completely replace the original args, append to them, modify them, etc.
in general, implementations should be abstract override with a call to super, to allow multiple external configs via the Stackable Trait Pattern
Use this function to make an annotation automatically imply a validation function.
Use this function to make an annotation automatically imply a validation function. This registers the annotation with *this* instance, so that any use of the annotation automatically adds the validation function on the field.
In general, if you create user-defined annotation validation functions, you will want to call this in a base trait, which all your arg classes extend, so you can use those annotations anywhere.
the class of the annotation to add a validation function to
the function that will be called to validate every field marked w/ the annotation. The first argument is the default value of the argument, the second is the current value, the third is the annotation, and the fourth is the name of the argument (for error msgs).
add the ability to parse your own custom types.
add the ability to parse your own custom types. Note that this registers the parser *globally*, not just for this object.
run all validation functions.
run all validation functions.
Note that parse automatically runs all validation, so in general a user will not need to call this. However, if you are programatically filling in the the args of this object, you probably want to call this.
save the config back to the external source.
save the config back to the external source. Any parameters for this method should have already been extracted from the call to readArgs
as with readArgs, this should in general be implemented as an abstract override with a call to super