cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r325973 - in /cocoon/blocks/template/trunk: WEB-INF/xconf/ java/org/apache/cocoon/components/expression/ java/org/apache/cocoon/template/ java/org/apache/cocoon/template/environment/ java/org/apache/cocoon/template/expression/ java/org/apac...
Date Mon, 17 Oct 2005 20:02:01 GMT
Author: lgawron
Date: Mon Oct 17 12:59:39 2005
New Revision: 325973

URL: http://svn.apache.org/viewcvs?rev=325973&view=rev
Log:
refactored some class names

Added:
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultStringTemplateParser.java
      - copied, changed from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/NewStyleJXTExpressionCompiler.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTGStringTemplateParser.java
      - copied, changed from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultJXTExpressionCompiler.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/StringTemplateParser.java
      - copied, changed from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTExpressionCompiler.java
Removed:
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultJXTExpressionCompiler.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTExpressionCompiler.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/NewStyleJXTExpressionCompiler.java
Modified:
    cocoon/blocks/template/trunk/WEB-INF/xconf/cocoon-template.xconf
    cocoon/blocks/template/trunk/java/org/apache/cocoon/components/expression/ExpressionFactory.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/TransformerAdapter.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/environment/ParsingContext.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/Substitutions.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Attribute.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Call.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Eval.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ForEach.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatDate.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/If.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Import.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/LocaleAwareInstruction.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ParameterInstance.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Set.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/When.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/DefaultScriptManager.java
    cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/Parser.java
    cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.xtest

Modified: cocoon/blocks/template/trunk/WEB-INF/xconf/cocoon-template.xconf
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/WEB-INF/xconf/cocoon-template.xconf?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/WEB-INF/xconf/cocoon-template.xconf (original)
+++ cocoon/blocks/template/trunk/WEB-INF/xconf/cocoon-template.xconf Mon Oct 17 12:59:39 2005
@@ -23,5 +23,5 @@
     <include src="context://WEB-INF/xconf/cocoon-template-expression.xconf"/>
     <component role="org.apache.cocoon.template.script.ScriptManager" class="org.apache.cocoon.template.script.DefaultScriptManager"/>
     <component role="org.apache.cocoon.template.script.InstructionFactory" class="org.apache.cocoon.template.script.DefaultInstructionFactory"/>
-    <component role="org.apache.cocoon.template.expression.JXTExpressionCompiler" class="org.apache.cocoon.template.expression.DefaultJXTExpressionCompiler"/>
+    <component role="org.apache.cocoon.template.expression.StringTemplateParser" class="org.apache.cocoon.template.expression.JXTGStringTemplateParser"/>
 </components>

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/components/expression/ExpressionFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/components/expression/ExpressionFactory.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/components/expression/ExpressionFactory.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/components/expression/ExpressionFactory.java
Mon Oct 17 12:59:39 2005
@@ -26,11 +26,9 @@
 /**
  * @version SVN $Id$
  */
-public class ExpressionFactory
-    extends AbstractLogEnabled
-    implements Disposable, Serviceable, ThreadSafe {
+public class ExpressionFactory extends AbstractLogEnabled implements Disposable, Serviceable,
ThreadSafe {
     public static String ROLE = ExpressionFactory.class.getName();
-    public static String DEFAULT_EXPRESSION_LANGUAGE ="default";
+    public static String DEFAULT_EXPRESSION_LANGUAGE = "default";
 
     /** The component manager */
     protected ServiceManager manager;
@@ -38,30 +36,27 @@
     /** The Expression compiler selector */
     protected ServiceSelector compilerSelector;
 
-    public void service(final ServiceManager manager)
-        throws ServiceException {
+    public void service(final ServiceManager manager) throws ServiceException {
         this.manager = manager;
 
-        this.compilerSelector =
-            (ServiceSelector)this.manager.lookup(ExpressionCompiler.ROLE + "Selector");
+        this.compilerSelector = (ServiceSelector) this.manager.lookup(ExpressionCompiler.ROLE
+ "Selector");
     }
 
     public void dispose() {
-        if(null != this.manager) {
+        if (null != this.manager) {
             this.manager.release(this.compilerSelector);
             this.compilerSelector = null;
         }
     }
 
-    public Expression getExpression(String language, String expression)
-        throws ExpressionException {
+    public Expression getExpression(String language, String expression) throws ExpressionException
{
 
         Expression expressionImpl = null;
         ExpressionCompiler compiler = null;
         try {
-            compiler = (ExpressionCompiler)this.compilerSelector.select(language);
+            compiler = (ExpressionCompiler) this.compilerSelector.select(language);
             expressionImpl = compiler.compile(language, expression);
-        } catch(final ServiceException ce) {
+        } catch (final ServiceException ce) {
             throw new ExpressionException("Can't find a compiler for " + language);
         } finally {
             this.compilerSelector.release(compiler);
@@ -74,7 +69,7 @@
         int end = expression.indexOf(':');
         if (end != -1) {
             language = expression.substring(0, end);
-            expression = expression.substring(end+1);
+            expression = expression.substring(end + 1);
         }
         return getExpression(language, expression);
     }

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/TransformerAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/TransformerAdapter.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/TransformerAdapter.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/TransformerAdapter.java Mon
Oct 17 12:59:39 2005
@@ -26,7 +26,7 @@
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.template.environment.ParsingContext;
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.InstructionFactory;
 import org.apache.cocoon.template.script.Parser;
 import org.apache.cocoon.transformation.ServiceableTransformer;
@@ -56,14 +56,14 @@
         public void service(ServiceManager manager) throws ServiceException {
             this.manager = manager;
             this.gen.service(manager);
-            setParsingContext(new ParsingContext((JXTExpressionCompiler) this.manager.lookup(JXTExpressionCompiler.ROLE),
+            setParsingContext(new ParsingContext((StringTemplateParser) this.manager.lookup(StringTemplateParser.ROLE),
                     (InstructionFactory) this.manager.lookup(InstructionFactory.ROLE)));
         }
 
         public void dispose() {
             setParsingContext( null );
             this.manager.release(this.parsingContext.getInstructionFactory());
-            this.manager.release(this.parsingContext.getJxtExpressionCompiler());
+            this.manager.release(this.parsingContext.getStringTemplateParser());
         }
 
         public void endDocument() throws SAXException {

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/environment/ParsingContext.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/environment/ParsingContext.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/environment/ParsingContext.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/environment/ParsingContext.java
Mon Oct 17 12:59:39 2005
@@ -15,7 +15,7 @@
  */
 package org.apache.cocoon.template.environment;
 
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.InstructionFactory;
 
 /**
@@ -23,18 +23,18 @@
  */
 public class ParsingContext {
     private InstructionFactory instructionFactory;
-    private JXTExpressionCompiler jxtExpressionCompiler;
+    private StringTemplateParser stringTemplateParser;
 
-    public ParsingContext(JXTExpressionCompiler jxtExpressionCompiler, InstructionFactory
instructionFactory) {
+    public ParsingContext(StringTemplateParser jxtExpressionCompiler, InstructionFactory
instructionFactory) {
         this.instructionFactory = instructionFactory;
-        this.jxtExpressionCompiler = jxtExpressionCompiler;
+        this.stringTemplateParser = jxtExpressionCompiler;
     }
 
     public InstructionFactory getInstructionFactory() {
         return instructionFactory;
     }
 
-    public JXTExpressionCompiler getJxtExpressionCompiler() {
-        return jxtExpressionCompiler;
+    public StringTemplateParser getStringTemplateParser() {
+        return stringTemplateParser;
     }
 }

Copied: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultStringTemplateParser.java
(from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/NewStyleJXTExpressionCompiler.java)
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultStringTemplateParser.java?p2=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultStringTemplateParser.java&p1=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/NewStyleJXTExpressionCompiler.java&r1=314813&r2=325973&rev=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/NewStyleJXTExpressionCompiler.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultStringTemplateParser.java
Mon Oct 17 12:59:39 2005
@@ -22,8 +22,8 @@
 /**
  * @version SVN $Id$ 
  */
-public class NewStyleJXTExpressionCompiler extends JXTExpressionCompiler {
-    public List compileSubstitutions(Reader in) throws Exception {
+public class DefaultStringTemplateParser extends StringTemplateParser {
+    public List parseSubstitutions(Reader in) throws Exception {
         LinkedList substitutions = new LinkedList();
         StringBuffer buf = new StringBuffer();
         buf.setLength(0);

Copied: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTGStringTemplateParser.java
(from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultJXTExpressionCompiler.java)
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTGStringTemplateParser.java?p2=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTGStringTemplateParser.java&p1=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultJXTExpressionCompiler.java&r1=314813&r2=325973&rev=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/DefaultJXTExpressionCompiler.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTGStringTemplateParser.java
Mon Oct 17 12:59:39 2005
@@ -22,11 +22,11 @@
 /**
  * @version SVN $Id$ 
  */
-public class DefaultJXTExpressionCompiler extends JXTExpressionCompiler {
+public class JXTGStringTemplateParser extends StringTemplateParser {
     public static String JXPATH = "jxpath";
     public static String JEXL = "jexl";
 
-    public List compileSubstitutions(Reader in) throws Exception {
+    public List parseSubstitutions(Reader in) throws Exception {
         LinkedList substitutions = new LinkedList();
         StringBuffer buf = new StringBuffer();
         buf.setLength(0);

Copied: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/StringTemplateParser.java
(from r314813, cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTExpressionCompiler.java)
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/StringTemplateParser.java?p2=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/StringTemplateParser.java&p1=cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTExpressionCompiler.java&r1=314813&r2=325973&rev=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/JXTExpressionCompiler.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/StringTemplateParser.java
Mon Oct 17 12:59:39 2005
@@ -36,8 +36,8 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
-public abstract class JXTExpressionCompiler extends AbstractLogEnabled implements Serviceable,
Disposable, ThreadSafe {
-    public static String ROLE = JXTExpressionCompiler.class.getName();
+public abstract class StringTemplateParser extends AbstractLogEnabled implements Serviceable,
Disposable, ThreadSafe {
+    public static String ROLE = StringTemplateParser.class.getName();
 
     private ServiceManager manager;
     private ExpressionFactory expressionFactory;
@@ -83,16 +83,12 @@
         return res;
     }
 
-    /**
-     * Compile a single Jexl expr (contained in ${}) or XPath expression
-     * (contained in #{})
-     */
     public JXTExpression compileExpr(String inStr, String errorPrefix, Locator location)
throws SAXParseException {
         if (inStr == null) {
             return null;
         }
         StringReader in = new StringReader(inStr.trim());
-        List substitutions = compileSubstitutions(in, errorPrefix, location);
+        List substitutions = parseSubstitutions(in, errorPrefix, location);
         if (substitutions.size() == 0 || !(substitutions.get(0) instanceof JXTExpression))
             return new JXTExpression(inStr, null);
 
@@ -100,11 +96,11 @@
     }
 
     /**
-     * Compile a set of expressions spaced with literals
+     * Parse a set of expressions spaced with literals
      */
-    public List compileSubstitutions(Reader in, String errorPrefix, Locator location) throws
SAXParseException {
+    public List parseSubstitutions(Reader in, String errorPrefix, Locator location) throws
SAXParseException {
         try {
-            return compileSubstitutions(in);
+            return parseSubstitutions(in);
         } catch (Exception exc) {
             throw new SAXParseException(errorPrefix + exc.getMessage(), location, exc);
         } catch (Error err) {
@@ -112,5 +108,5 @@
         }
     }
 
-    public abstract List compileSubstitutions(Reader in) throws Exception;
+    public abstract List parseSubstitutions(Reader in) throws Exception;
 }

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/Substitutions.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/Substitutions.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/Substitutions.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/expression/Substitutions.java
Mon Oct 17 12:59:39 2005
@@ -46,7 +46,7 @@
     }
 
     private Substitutions(ParsingContext parsingContext, Locator location, Reader in) throws
SAXException {
-        this.substitutions = parsingContext.getJxtExpressionCompiler().compileSubstitutions(
in, "", location );
+        this.substitutions = parsingContext.getStringTemplateParser().parseSubstitutions(
in, "", location );
         this.hasSubstitutions = !substitutions.isEmpty();
     }
 

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Attribute.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Attribute.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Attribute.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Attribute.java
Mon Oct 17 12:59:39 2005
@@ -35,7 +35,7 @@
             throw new SAXParseException("parameter: \"name\" is required",
                     locator, null);
         }
-        this.name = parsingContext.getJxtExpressionCompiler().compileExpr(name, "parameter:
\"name\": ",
+        this.name = parsingContext.getStringTemplateParser().compileExpr(name, "parameter:
\"name\": ",
                 locator);
 
         String value = attrs.getValue("value");
@@ -43,7 +43,7 @@
             throw new SAXParseException("parameter: \"value\" is required",
                     locator, null);
 
-        this.value = parsingContext.getJxtExpressionCompiler().compileExpr(value, "parameter:
\"value\": ",
+        this.value = parsingContext.getStringTemplateParser().compileExpr(value, "parameter:
\"value\": ",
                 locator);
     }
 

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Call.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Call.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Call.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Call.java Mon
Oct 17 12:59:39 2005
@@ -74,12 +74,12 @@
             throw new SAXParseException("if: \"test\" is required", locator,
                     null);
         }
-        this.macro = parsingContext.getJxtExpressionCompiler().compileExpr(name, "call: \"macro\":
",
+        this.macro = parsingContext.getStringTemplateParser().compileExpr(name, "call: \"macro\":
",
                 locator);
 
         String namespace = StringUtils.defaultString(attrs
                 .getValue("targetNamespace"));
-        this.targetNamespace = parsingContext.getJxtExpressionCompiler().compileExpr(namespace,
+        this.targetNamespace = parsingContext.getStringTemplateParser().compileExpr(namespace,
                 "call: \"targetNamespace\": ", locator);
     }
 

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Eval.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Eval.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Eval.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Eval.java Mon
Oct 17 12:59:39 2005
@@ -42,7 +42,7 @@
         super(raw);
 
         String select = attrs.getValue("select");
-        this.value = parsingContext.getJxtExpressionCompiler().compileExpr(select, "eval:
\"select\":", getLocation());
+        this.value = parsingContext.getStringTemplateParser().compileExpr(select, "eval:
\"select\":", getLocation());
     }
 
     public Event execute(final XMLConsumer consumer,

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ForEach.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ForEach.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ForEach.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ForEach.java
Mon Oct 17 12:59:39 2005
@@ -23,7 +23,7 @@
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
 import org.apache.cocoon.template.expression.JXTExpression;
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.Invoker;
 import org.apache.cocoon.template.script.event.Event;
 import org.apache.cocoon.template.script.event.StartElement;
@@ -57,7 +57,7 @@
         String items = attrs.getValue("items");
         String select = attrs.getValue("select");
         
-        JXTExpressionCompiler expressionCompiler = parsingContext.getJxtExpressionCompiler();
+        StringTemplateParser expressionCompiler = parsingContext.getStringTemplateParser();
         this.var = expressionCompiler.compileExpr(attrs.getValue("var"), null, locator);
         this.varStatus = expressionCompiler.compileExpr(attrs.getValue("varStatus"), null,
locator);
         this.begin = expressionCompiler.compileInt(attrs.getValue("begin"), name, locator);

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatDate.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatDate.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatDate.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatDate.java
Mon Oct 17 12:59:39 2005
@@ -26,7 +26,7 @@
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
 import org.apache.cocoon.template.expression.JXTExpression;
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.event.Event;
 import org.apache.cocoon.template.script.event.StartElement;
 import org.apache.cocoon.xml.XMLConsumer;
@@ -56,7 +56,7 @@
 
         Locator locator = getLocation();
 
-        JXTExpressionCompiler expressionCompiler = parsingContext.getJxtExpressionCompiler();
+        StringTemplateParser expressionCompiler = parsingContext.getStringTemplateParser();
         this.var = expressionCompiler.compileExpr(attrs.getValue("var"), null, locator);
         this.value = expressionCompiler.compileExpr(attrs.getValue("value"), null, locator);
         this.type = expressionCompiler.compileExpr(attrs.getValue("type"), null, locator);

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/FormatNumber.java
Mon Oct 17 12:59:39 2005
@@ -27,7 +27,7 @@
 import org.apache.cocoon.template.environment.ExecutionContext;
 import org.apache.cocoon.template.environment.ParsingContext;
 import org.apache.cocoon.template.expression.JXTExpression;
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.event.Event;
 import org.apache.cocoon.template.script.event.StartElement;
 import org.apache.cocoon.xml.XMLConsumer;
@@ -75,7 +75,7 @@
 
         Locator locator = getLocation();
 
-        JXTExpressionCompiler expressionCompiler = parsingContext.getJxtExpressionCompiler();
+        StringTemplateParser expressionCompiler = parsingContext.getStringTemplateParser();
         this.value = expressionCompiler.compileExpr(attrs.getValue("value"), null, locator);
         this.type = expressionCompiler.compileExpr(attrs.getValue("type"), null, locator);
         this.pattern = expressionCompiler.compileExpr(attrs.getValue("pattern"), null, locator);

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/If.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/If.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/If.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/If.java Mon Oct
17 12:59:39 2005
@@ -44,7 +44,7 @@
         Locator locator = getLocation();
         String test = attrs.getValue("test");
         if (test != null) {
-            this.test = parsingContext.getJxtExpressionCompiler().compileExpr(test, "if:
\"test\": ", locator);
+            this.test = parsingContext.getStringTemplateParser().compileExpr(test, "if: \"test\":
", locator);
             // Why is test lenient?
             this.test.setLenient(Boolean.TRUE);
         } else {

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Import.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Import.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Import.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Import.java Mon
Oct 17 12:59:39 2005
@@ -70,7 +70,7 @@
             // as the context object in the imported template
             String context = attrs.getValue("context");
             if (context != null) {
-                select = parsingContext.getJxtExpressionCompiler().compileExpr(context, "import:
\"context\": ", locator);
+                select = parsingContext.getStringTemplateParser().compileExpr(context, "import:
\"context\": ", locator);
             }
         } else {
             throw new SAXParseException("import: \"uri\" is required", locator, null);

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/LocaleAwareInstruction.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/LocaleAwareInstruction.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/LocaleAwareInstruction.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/LocaleAwareInstruction.java
Mon Oct 17 12:59:39 2005
@@ -34,7 +34,7 @@
 
     public LocaleAwareInstruction(ParsingContext parsingContext, StartElement raw, Attributes
attrs, Stack stack) throws SAXException {
         super(raw);
-        this.locale = parsingContext.getJxtExpressionCompiler().compileExpr(attrs.getValue("locale"),
null, getLocation());
+        this.locale = parsingContext.getStringTemplateParser().compileExpr(attrs.getValue("locale"),
null, getLocation());
     }
 
     protected Locale getLocale(ExpressionContext expressionContext) throws Exception {

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Out.java Mon
Oct 17 12:59:39 2005
@@ -55,7 +55,7 @@
         if (value == null)
             throw new SAXParseException("out: \"value\" is required", locator, null);
 
-        this.compiledExpression = parsingContext.getJxtExpressionCompiler().compileExpr(value,
"out: \"value\": ", locator);
+        this.compiledExpression = parsingContext.getStringTemplateParser().compileExpr(value,
"out: \"value\": ", locator);
         String lenientValue = attrs.getValue("lenient");
         Boolean lenient = lenientValue == null ? null : Boolean.valueOf(lenientValue);
 

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ParameterInstance.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ParameterInstance.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ParameterInstance.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/ParameterInstance.java
Mon Oct 17 12:59:39 2005
@@ -53,7 +53,7 @@
             if (val == null)
                 throw new SAXParseException("parameter: \"value\" is required", locator,
null);
 
-            this.value = parsingContext.getJxtExpressionCompiler().compileExpr(val, "parameter:
\"value\": ", locator);
+            this.value = parsingContext.getStringTemplateParser().compileExpr(val, "parameter:
\"value\": ", locator);
         }
     }
 

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Set.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Set.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Set.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/Set.java Mon
Oct 17 12:59:39 2005
@@ -51,10 +51,10 @@
         JXTExpression varExpr = null;
         JXTExpression valueExpr = null;
         if (var != null) {
-            varExpr = parsingContext.getJxtExpressionCompiler().compileExpr(var, "set: \"var\":",
locator);
+            varExpr = parsingContext.getStringTemplateParser().compileExpr(var, "set: \"var\":",
locator);
         }
         if (value != null) {
-            valueExpr = parsingContext.getJxtExpressionCompiler().compileExpr(value, "set:
\"value\":", locator);
+            valueExpr = parsingContext.getStringTemplateParser().compileExpr(value, "set:
\"value\":", locator);
         }
         this.var = varExpr;
         this.value = valueExpr;

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/When.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/When.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/When.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/instruction/When.java Mon
Oct 17 12:59:39 2005
@@ -44,7 +44,7 @@
         }
         String test = attrs.getValue("test");
         if (test != null) {
-            this.test = parsingContext.getJxtExpressionCompiler().compileExpr(test, "when:
\"test\": ", locator);
+            this.test = parsingContext.getStringTemplateParser().compileExpr(test, "when:
\"test\": ", locator);
             // Why is test lenient?
             this.test.setLenient(Boolean.TRUE);
             

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/DefaultScriptManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/DefaultScriptManager.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/DefaultScriptManager.java
(original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/DefaultScriptManager.java
Mon Oct 17 12:59:39 2005
@@ -23,7 +23,7 @@
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.template.environment.ParsingContext;
-import org.apache.cocoon.template.expression.JXTExpressionCompiler;
+import org.apache.cocoon.template.expression.StringTemplateParser;
 import org.apache.cocoon.template.script.event.StartDocument;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
@@ -42,7 +42,7 @@
     private final static String JX_STORE_PREFIX = "jxtg:";
     private Store store;
     private InstructionFactory instructionFactory;
-    private JXTExpressionCompiler jxtExpressionCompiler;
+    private StringTemplateParser jxtExpressionCompiler;
 
     public DefaultScriptManager() {
     }
@@ -51,7 +51,7 @@
         this.manager = manager;
         this.store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
         this.instructionFactory = (InstructionFactory) this.manager.lookup(InstructionFactory.ROLE);
-        this.jxtExpressionCompiler = (JXTExpressionCompiler) this.manager.lookup(JXTExpressionCompiler.ROLE);
+        this.jxtExpressionCompiler = (StringTemplateParser) this.manager.lookup(StringTemplateParser.ROLE);
     }
 
     public void dispose() {

Modified: cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/Parser.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/Parser.java?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/Parser.java (original)
+++ cocoon/blocks/template/trunk/java/org/apache/cocoon/template/script/Parser.java Mon Oct
17 12:59:39 2005
@@ -174,7 +174,7 @@
                 // root
                 getStartEvent().getTemplateProperties().put(
                         elementAttributes.getLocalName(i),
-                        this.parsingContext.getJxtExpressionCompiler().compileExpr(elementAttributes.getValue(i),
null,
+                        this.parsingContext.getStringTemplateParser().compileExpr(elementAttributes.getValue(i),
null,
                                 locator));
                 elementAttributes.removeAttribute(i--);
             }

Modified: cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.xtest
URL: http://svn.apache.org/viewcvs/cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.xtest?rev=325973&r1=325972&r2=325973&view=diff
==============================================================================
--- cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.xtest
(original)
+++ cocoon/blocks/template/trunk/test/org/apache/cocoon/template/jxtg/JXTemplateGeneratorTestCase.xtest
Mon Oct 17 12:59:39 2005
@@ -38,7 +38,7 @@
         <store logger="test"/>
         <component role="org.apache.cocoon.template.script.ScriptManager" class="org.apache.cocoon.template.script.DefaultScriptManager"/>
         <component role="org.apache.cocoon.template.script.InstructionFactory" class="org.apache.cocoon.template.script.DefaultInstructionFactory"/>
-        <component role="org.apache.cocoon.template.expression.JXTExpressionCompiler"
class="org.apache.cocoon.template.expression.DefaultJXTExpressionCompiler"/>
+        <component role="org.apache.cocoon.template.expression.StringTemplateParser" class="org.apache.cocoon.template.expression.JXTGStringTemplateParser"/>
         <expression-factory/>
         <expression-compilers>
             <component-instance class="org.apache.cocoon.components.expression.jxpath.JXPathCompiler"
name="default"/>



Mime
View raw message