[prev in list] [next in list] [prev in thread] [next in thread]
List: xml-cocoon-cvs
Subject: cvs commit: cocoon-2.1/src/blocks/woody/java/org/apache/cocoon/woody/transformation EffectWidgetRepl
From: bruno () apache ! org
Date: 2004-01-31 16:49:54
Message-ID: 20040131164954.12305.qmail () minotaur ! apache ! org
[Download RAW message or body]
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 <wi:styling>
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); }
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic