"Diethelm Guallar, Gonzalo" <[EMAIL PROTECTED]> writes:

> This will probably prove I'm clueless... anyway...
> 
> File ActionLoader, method exec(), does this:
> 
>   getInstance(name).perform(data);
> 
> Method getInstance() returns an object of class
> Action. This class declares method perform as:
> 
>     protected void perform( RunData data )
>         throws Exception;
> 
> Stupid question: how can ActionLoader invoke method
> perform() over an Action object, if this method is
> declared a protected? Shouldn't it be accessible only
> to class Action and all its descendants?

Protected methods have package-level visibility (in addition to
derived class visibility).

> I realized this when trying to change the invocation
> to a method passed as a String parameter. When trying
> to reflect the default method name ("perform"), I
> get an exception NoSuchMethod.

I suppose you could subclass Action and wrap the protected method in a
public pass through.

Daniel


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to