Author: ilgrosso
Date: Fri Apr 27 12:56:16 2012
New Revision: 1331403
URL: http://svn.apache.org/viewvc?rev=1331403&view=rev
Log:
[COCOON3-64] Moving ParamSAXBuffer from C3's I18nTRansformer to its own place
Removed:
cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/xml/
Modified:
cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
Modified: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java?rev=1331403&r1=1331402&r2=1331403&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/I18nTransformer.java Fri Apr 27 12:56:16 2012
@@ -46,6 +46,7 @@ import org.apache.cocoon.sax.util.Variab
import org.apache.cocoon.sax.util.VariableExpressionTokenizer.TokenReceiver;
import org.apache.cocoon.sax.util.XMLUtils;
import org.apache.cocoon.xml.sax.ParamSAXBuffer;
+import org.apache.cocoon.xml.sax.ParamSAXFragmentBuffer;
import org.apache.cocoon.xml.sax.SAXBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1006,7 +1007,7 @@ public class I18nTransformer extends Abs
if (currentKey != null) {
final ParamSAXBuffer message =
- getMessage(currentKey, FragmentBuffer.class);
+ getMessage(currentKey, ParamSAXFragmentBuffer.class);
translatedTextRecorder = message;
}
} else if (ELEM_TRANSLATE.equals(name)) {
@@ -1960,42 +1961,6 @@ public class I18nTransformer extends Abs
return buffer;
}
-
- /**
- * SAX buffer which passes only the content of the document element to the content handler.
- * An element with an arbitrary local name can be used the wrapper element.
- */
- protected static final class FragmentBuffer extends ParamSAXBuffer {
-
- private static final long serialVersionUID = -9153292487513611344L;
-
- private int depth = 0;
-
- @Override
- public void startDocument() throws SAXException {}
-
- @Override
- public void endDocument() throws SAXException {}
-
- @Override
- public void startElement(String namespaceURI, String localName, String qName,
- Attributes atts) throws SAXException {
- if (this.depth > 0) {
- super.startElement(namespaceURI, localName, qName, atts);
- }
- this.depth++;
- }
-
- @Override
- public void endElement(String namespaceURI, String localName, String qName)
- throws SAXException {
- this.depth--;
- if (this.depth > 0) {
- super.endElement(namespaceURI, localName, qName);
- }
- }
-
- }
/**
* Helper method to retrieve a message from the current dictionary.
@@ -2010,7 +1975,7 @@ public class I18nTransformer extends Abs
final ParamSAXBuffer defaultValue)
throws SAXException {
- ParamSAXBuffer result = getMessage(key, FragmentBuffer.class);
+ ParamSAXBuffer result = getMessage(key, ParamSAXFragmentBuffer.class);
if (result == null) {
result = defaultValue;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.