Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 12354 invoked from network); 31 Jan 2004 16:49:56 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 31 Jan 2004 16:49:56 -0000 Received: (qmail 94740 invoked by uid 500); 31 Jan 2004 16:49:50 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 94673 invoked by uid 500); 31 Jan 2004 16:49:48 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 94658 invoked by uid 500); 31 Jan 2004 16:49:48 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 94653 invoked from network); 31 Jan 2004 16:49:48 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 31 Jan 2004 16:49:48 -0000 Received: (qmail 12306 invoked by uid 1638); 31 Jan 2004 16:49:54 -0000 Date: 31 Jan 2004 16:49:54 -0000 Message-ID: <20040131164954.12305.qmail@minotaur.apache.org> From: bruno@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation EffectWidgetReplacingPipe.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N bruno 2004/01/31 08:49:54 Modified: src/blocks/woody/java/org/apache/cocoon/woody/transformation EffectWidgetReplacingPipe.java Log: Fix JDK 1.3 runtime errors (NoSuchMethodError on referencing protected member from parent of outer class) Revision Changes Path 1.7 +26 -8 cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/EffectWidgetReplacingPipe.java Index: EffectWidgetReplacingPipe.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation/EffectWidgetReplacingPipe.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- EffectWidgetReplacingPipe.java 23 Jan 2004 18:42:52 -0000 1.6 +++ EffectWidgetReplacingPipe.java 31 Jan 2004 16:49:54 -0000 1.7 @@ -69,6 +69,8 @@ import org.apache.commons.jxpath.JXPathException; import org.xml.sax.Attributes; import org.xml.sax.SAXException; +import org.xml.sax.ContentHandler; +import org.xml.sax.ext.LexicalHandler; import org.xml.sax.helpers.AttributesImpl; // TODO: Reduce the Element creation and deletion churn by using startElement @@ -219,6 +221,22 @@ throwSAXException(pipeName + ": Element \"" + element + "\" can only be used for " + widget + " widgets."); } + /** + * Needed to get things working with JDK 1.3. Can be removed once we + * don't support that platform any more. + */ + private ContentHandler getContentHandler() { + return this.contentHandler; + } + + /** + * Needed to get things working with JDK 1.3. Can be removed once we + * don't support that platform any more. + */ + private LexicalHandler getLexicalHandler() { + return this.lexicalHandler; + } + public Handler nestedTemplate() throws SAXException { if (Constants.WT_NS.equals(input.uri)) { // Element in woody template namespace. @@ -354,7 +372,7 @@ case EVENT_START_ELEMENT: widgetId = getWidgetId(input.attrs); Widget widget = getWidget(widgetId); - widget.generateLabel(contentHandler); + widget.generateLabel(getContentHandler()); widget = null; return this; case EVENT_ELEMENT: @@ -387,8 +405,8 @@ case EVENT_END_ELEMENT: stylingHandler.recycle(); stylingHandler.setSaxFragment(out.getBuffer()); - stylingHandler.setContentHandler(contentHandler); - stylingHandler.setLexicalHandler(lexicalHandler); + stylingHandler.setContentHandler(getContentHandler()); + stylingHandler.setLexicalHandler(getLexicalHandler()); widget.generateSaxFragment(stylingHandler, pipeContext.getLocale()); widget = null; out.bufferFini(); @@ -406,7 +424,7 @@ switch(event) { case EVENT_START_ELEMENT: getRepeaterWidget("RepeaterSizeHandler"); - ((Repeater)widget).generateSize(contentHandler); + ((Repeater)widget).generateSize(getContentHandler()); widget = null; return this; case EVENT_ELEMENT: @@ -428,7 +446,7 @@ String widgetId = input.attrs.getValue("widget-id"); if (widgetId == null || widgetId.equals("")) throwSAXException("Element repeater-widget-label missing required widget-id attribute."); - ((Repeater)widget).generateWidgetLabel(widgetId, contentHandler); + ((Repeater)widget).generateWidgetLabel(widgetId, getContentHandler()); widget = null; return this; case EVENT_ELEMENT: @@ -672,11 +690,11 @@ if (elementNesting == 0 && saxBuffer != null) { if (gotStylingElement) { // Just deserialize - saxBuffer.toSAX(contentHandler); + saxBuffer.toSAX(getContentHandler()); } else { // Insert an enclosing out.startElement(Constants.WI_NS, STYLING_EL, Constants.WI_PREFIX_COLON + STYLING_EL, Constants.EMPTY_ATTRS); - saxBuffer.toSAX(contentHandler); + saxBuffer.toSAX(getContentHandler()); out.endElement(Constants.WI_NS, STYLING_EL, Constants.WI_PREFIX_COLON + STYLING_EL); } }