Without having looked at this specific example, they're probably
overriding protected methods from the parent class (abstract
protected, perhaps?).  In which case, they need to be protected,
but if they aren't intended for overriding, they're marked final.

-- Adam


On 5/14/06, Rogers Reilly <[EMAIL PROTECTED]> wrote:
Hi,

I'm looking into extending <af:table>, and had a question about the use
of "final" on several protected methods- notably the
"renderRegularHeaders" method in DesktopTableRenderer.  All I need to do
is stick javascript onmouseover/onmouseout events (a feature the
Tomahawk table has in the form of "rowOnMouseover/rowOnMouseout") on the
TR element, which gets written there, but because the method is marked
"final," I'm stuck overriding a method way higher up the stack (haven't
figured out exactly how high yet) and copying a bunch of code verbatim.

I ran into a similar issue adding the defaultSortOrder feature I
submitted a JIRA issue about earlier; some "final" method of
ColumnGroupRenderer necessitated my extending XhtmlRenderer directly
with lots of copied code, rather than extending ColumnGroupRenderer and
overriding a method or two.  (by the way, will provide working
defaultSortOrder code when I get a sec)

My question--and this is an honest question, I'm a relatively new and
self-taught Java developer--is what does marking these methods "final"
buy you?  If they're marked "protected," it seems like they're designed
to be overriden.  A lot of the features I'd like to add--little
Javascript here and there, maybe inline CSS on child table elements,
etc--is piddly stuff that would be great to be able to implement with
polymorphism.

Thanks in advance,
Rogers

Reply via email to