cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r565890 - in /cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template: expression/ script/event/
Date Tue, 14 Aug 2007 19:56:41 GMT
Author: gkossakowski
Date: Tue Aug 14 12:56:40 2007
New Revision: 565890

URL: http://svn.apache.org/viewvc?view=rev&rev=565890
Log:
COCOON-2112: Strip off dependencies on classes outside org.apache.cocoon.template.expresssion
package.

Modified:
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/AbstractStringTemplateParser.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
    cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/AbstractStringTemplateParser.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/AbstractStringTemplateParser.java?view=diff&rev=565890&r1=565889&r2=565890
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/AbstractStringTemplateParser.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/AbstractStringTemplateParser.java
Tue Aug 14 12:56:40 2007
@@ -27,7 +27,6 @@
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.expression.ExpressionFactory;
-import org.apache.cocoon.template.environment.ErrorHolder;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
@@ -111,8 +110,9 @@
             return parseSubstitutions(in);
         } catch (Exception exc) {
             throw new SAXParseException(errorPrefix + exc.getMessage(), location, exc);
-        } catch (Error err) {
-            throw new SAXParseException(errorPrefix + err.getMessage(), location, new ErrorHolder(err));
+        //FIXME: Don't catch java.lang.Error
+        //} catch (Error err) {
+        //    throw new SAXParseException(errorPrefix + err.getMessage(), location, new ErrorHolder(err));
         }
     }
 }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java?view=diff&rev=565890&r1=565889&r2=565890
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/expression/Substitutions.java
Tue Aug 14 12:56:40 2007
@@ -23,8 +23,6 @@
 import java.util.List;
 
 import org.apache.cocoon.objectmodel.ObjectModel;
-import org.apache.cocoon.template.environment.ErrorHolder;
-import org.apache.cocoon.template.environment.ParsingContext;
 import org.xml.sax.Locator;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
@@ -37,17 +35,17 @@
     final private List substitutions;
     final private boolean hasSubstitutions;
 
-    public Substitutions(ParsingContext parsingContext, Locator location, String stringTemplate)
throws SAXException {
-        this(parsingContext, location, new StringReader(stringTemplate));
+    public Substitutions(StringTemplateParser stringTemplateParser, Locator location, String
stringTemplate) throws SAXException {
+        this(stringTemplateParser, location, new StringReader(stringTemplate));
     }
 
-    public Substitutions(ParsingContext parsingContext, Locator location, char[] chars, int
start, int length)
+    public Substitutions(StringTemplateParser stringTemplateParser, Locator location, char[]
chars, int start, int length)
             throws SAXException {
-        this(parsingContext, location, new CharArrayReader(chars, start, length));
+        this(stringTemplateParser, location, new CharArrayReader(chars, start, length));
     }
 
-    private Substitutions(ParsingContext parsingContext, Locator location, Reader in) throws
SAXException {
-        this.substitutions = parsingContext.getStringTemplateParser().parseSubstitutions(
in, "", location );
+    private Substitutions(StringTemplateParser stringTemplateParser, Locator location, Reader
in) throws SAXException {
+        this.substitutions = stringTemplateParser.parseSubstitutions( in, "", location );
         this.hasSubstitutions = !substitutions.isEmpty();
     }
 
@@ -82,8 +80,9 @@
                     val = expr.getValue(objectModel);
                 } catch (Exception e) {
                     throw new SAXParseException(e.getMessage(), location, e);
-                } catch (Error err) {
-                    throw new SAXParseException(err.getMessage(), location, new ErrorHolder(err));
+                //FIXME: Don't catch java.lang.Error
+                //} catch (Error err) {
+                //    throw new SAXParseException(err.getMessage(), location, new ErrorHolder(err));
                 }
                 buf.append(val != null ? val.toString() : "");
             }

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java?view=diff&rev=565890&r1=565889&r2=565890
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/StartElement.java
Tue Aug 14 12:56:40 2007
@@ -50,7 +50,7 @@
             String qname = attrs.getQName(i);
             String type = attrs.getType(i);
             String value = attrs.getValue(i);
-            Substitutions substitutions = new Substitutions(parsingContext, getLocation(),
value);
+            Substitutions substitutions = new Substitutions(parsingContext.getStringTemplateParser(),
getLocation(), value);
             if (substitutions.hasSubstitutions()) {
                 getAttributeEvents().add(
                         new SubstituteAttribute(uri, local, qname, type,

Modified: cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java?view=diff&rev=565890&r1=565889&r2=565890
==============================================================================
--- cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
(original)
+++ cocoon/trunk/blocks/cocoon-template/cocoon-template-impl/src/main/java/org/apache/cocoon/template/script/event/TextEvent.java
Tue Aug 14 12:56:40 2007
@@ -39,7 +39,7 @@
         super(location);
         this.raw = new char[length];
         System.arraycopy(chars, start, this.raw, 0, length);
-        this.substitutions = new Substitutions(parsingContext, getLocation(), chars, start,
length);
+        this.substitutions = new Substitutions(parsingContext.getStringTemplateParser(),
getLocation(), chars, start, length);
     }
 
     final Substitutions substitutions;



Mime
View raw message