Extended ParameterDef in different package
Brought to you by:
dsosnoski
You are unable to extend ParameterDef (create classes
that extend the abstract ParameterDef class) in
anything other than the org.jargp package.
The problem is that when you extend the ParameterDef
class you need to implement the abstract handle()
method. The handle() method has a ArgumentProcessor
parameter which you use in your implementation.
However, because the setValue() method of
ArgumentProcessor has package visibility you cannot
call it unless your class is in anything other than the
org.jargp package.
The visibility of the ArgumentProcessor::setValue()
method should be changed to public (from package).
Logged In: YES
user_id=1103654
I think it would be better if ParameterDef provided a
protected method to set it, which in turn invokes
ArgumentProcessor.setValue(). People subclassing
ParameterDef shouldn't have to handle callbacks into other
classes; ParameterDef should handle that for them.