commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/jelly/jelly-tags/betwixt/src/test/org/apache/commons/jelly/betwixt TestJelly.java
Date Thu, 09 Sep 2004 12:07:06 GMT
dion        2004/09/09 05:07:06

  Modified:    jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf
                        JellyContextRegistry.java JavaScriptTagLibrary.java
                        JythonTagLibrary.java JPythonTagLibrary.java
                        BSFExpressionFactory.java BSFExpression.java
                        PNutsTagLibrary.java
               jelly/jelly-tags/beanshell/src/test/org/apache/commons/jelly/tags/beanshell
                        TestJelly.java TestBeanShellEL.java
               jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell
                        BeanShellExpression.java JellyInterpreter.java
                        BeanShellTagLibrary.java ScriptTag.java
                        BeanShellExpressionFactory.java
               jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt
                        BetwixtTagLibrary.java IntrospectorTag.java
                        ParseTag.java
               jelly/jelly-tags/betwixt/src/test/org/apache/commons/jelly/betwixt
                        TestJelly.java
  Log:
  Fix license file whitespace
  
  Revision  Changes    Path
  1.5       +5 -5      jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JellyContextRegistry.java
  
  Index: JellyContextRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JellyContextRegistry.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JellyContextRegistry.java	25 Feb 2004 01:31:53 -0000	1.4
  +++ JellyContextRegistry.java	9 Sep 2004 12:07:05 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -47,7 +47,7 @@
       }
   
       // ObjectRegistry interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public Object lookup(String name) {
           return context.getVariable(name);
       }
  
  
  
  1.4       +4 -4      jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JavaScriptTagLibrary.java
  
  Index: JavaScriptTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JavaScriptTagLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JavaScriptTagLibrary.java	25 Feb 2004 01:31:53 -0000	1.3
  +++ JavaScriptTagLibrary.java	9 Sep 2004 12:07:05 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  
  
  
  1.4       +4 -4      jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JythonTagLibrary.java
  
  Index: JythonTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JythonTagLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JythonTagLibrary.java	25 Feb 2004 01:31:53 -0000	1.3
  +++ JythonTagLibrary.java	9 Sep 2004 12:07:05 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  
  
  
  1.4       +4 -4      jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JPythonTagLibrary.java
  
  Index: JPythonTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/JPythonTagLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JPythonTagLibrary.java	25 Feb 2004 01:31:53 -0000	1.3
  +++ JPythonTagLibrary.java	9 Sep 2004 12:07:05 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  
  
  
  1.6       +20 -20    jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java
  
  Index: BSFExpressionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/BSFExpressionFactory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BSFExpressionFactory.java	25 Feb 2004 01:31:53 -0000	1.5
  +++ BSFExpressionFactory.java	9 Sep 2004 12:07:05 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -34,27 +34,27 @@
   
       /** The logger of messages */
       private Log log = LogFactory.getLog( getClass() );
  -    
  +
       private String language = "javascript";
       private BSFManager manager;
       private BSFEngine engine;
       private JellyContextRegistry registry = new JellyContextRegistry();
  -    
  +
       public BSFExpressionFactory() {
       }
  -    
  +
       // Properties
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
   
       /** @return the BSF language to be used */
       public String getLanguage() {
           return language;
       }
  -    
  +
       public void setLanguage(String language) {
           this.language = language;
       }
  -    
  +
       /** @return the BSF Engine to be used by this expression factory */
       public BSFEngine getBSFEngine() throws BSFException {
           if ( engine == null ) {
  @@ -62,11 +62,11 @@
           }
           return engine;
       }
  -    
  +
       public void setBSFEngine(BSFEngine engine) {
           this.engine = engine;
       }
  -    
  +
       public BSFManager getBSFManager() {
           if ( manager == null ) {
               manager = createBSFManager();
  @@ -74,14 +74,14 @@
           }
           return manager;
       }
  -    
  +
       public void setBSFManager(BSFManager manager) {
           this.manager = manager;
           manager.setObjectRegistry( registry );
       }
  -    
  +
       // ExpressionFactory interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public Expression createExpression(String text) throws JellyException {
           try {
               return new BSFExpression( text, getBSFEngine(), getBSFManager(), registry );
  @@ -89,15 +89,15 @@
               throw new JellyException("Could not obtain BSF engine",e);
           }
       }
  -    
  +
       // Implementation methods
  -    //------------------------------------------------------------------------- 
  -    
  +    //-------------------------------------------------------------------------
  +
       /** Factory method */
  -    protected BSFEngine createBSFEngine() throws BSFException {        
  +    protected BSFEngine createBSFEngine() throws BSFException {
           return getBSFManager().loadScriptingEngine( getLanguage() );
       }
  -    
  +
       /** Factory method */
       protected BSFManager createBSFManager() {
           BSFManager answer = new BSFManager();
  
  
  
  1.5       +10 -10    jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java
  
  Index: BSFExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/BSFExpression.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BSFExpression.java	25 Feb 2004 01:31:53 -0000	1.4
  +++ BSFExpression.java	9 Sep 2004 12:07:05 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -39,15 +39,15 @@
   
       /** The expression */
       private String text;
  -    
  +
       /** The BSF Engine to evaluate expressions */
       private BSFEngine engine;
       /** The BSF Manager to evaluate expressions */
       private BSFManager manager;
  -    
  +
       /** The adapter to BSF's ObjectRegistry that uses the JellyContext */
       private JellyContextRegistry registry;
  -    
  +
       public BSFExpression(String text, BSFEngine engine, BSFManager manager, JellyContextRegistry
registry) {
           this.text = text;
           this.engine = engine;
  @@ -56,11 +56,11 @@
       }
   
       // Expression interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public String getExpressionText() {
           return "${" + text + "}";
       }
  -    
  +
       public Object evaluate(JellyContext context) {
           // XXXX: unfortunately we must sychronize evaluations
           // so that we can swizzle in the context.
  @@ -68,7 +68,7 @@
           // (and so create a BSFManager for a context)
           synchronized (registry) {
               registry.setJellyContext(context);
  -            
  +
               try {
                   // XXXX: hack - there must be a better way!!!
                   for ( Iterator iter = context.getVariableNames(); iter.hasNext(); ) {
  
  
  
  1.5       +7 -7      jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/PNutsTagLibrary.java
  
  Index: PNutsTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/bsf/src/java/org/apache/commons/jelly/tags/bsf/PNutsTagLibrary.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PNutsTagLibrary.java	25 Feb 2004 01:31:53 -0000	1.4
  +++ PNutsTagLibrary.java	9 Sep 2004 12:07:05 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -26,11 +26,11 @@
   
       public PNutsTagLibrary() {
           BSFManager.registerScriptingEngine(
  -            "pnuts", 
  -            "pnuts.ext.PnutsBSFEngine", 
  +            "pnuts",
  +            "pnuts.ext.PnutsBSFEngine",
               new String[]{"pnut"}
           );
           setLanguage( "pnuts" );
       }
  -    
  +
   }
  
  
  
  1.4       +7 -7      jakarta-commons/jelly/jelly-tags/beanshell/src/test/org/apache/commons/jelly/tags/beanshell/TestJelly.java
  
  Index: TestJelly.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/test/org/apache/commons/jelly/tags/beanshell/TestJelly.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestJelly.java	25 Feb 2004 01:31:56 -0000	1.3
  +++ TestJelly.java	9 Sep 2004 12:07:06 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -20,7 +20,7 @@
   
   import org.apache.commons.jelly.tags.junit.JellyTestSuite;
   
  -/** 
  +/**
    * A helper class to run jelly test cases as part of Ant's JUnit tests
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -31,8 +31,8 @@
       public static void main( String[] args ) throws Exception {
           TestRunner.run( suite() );
       }
  -    
  +
       public static TestSuite suite() throws Exception {
  -        return createTestSuite(TestJelly.class, "suite.jelly");        
  +        return createTestSuite(TestJelly.class, "suite.jelly");
       }
   }
  
  
  
  1.4       +15 -15    jakarta-commons/jelly/jelly-tags/beanshell/src/test/org/apache/commons/jelly/tags/beanshell/TestBeanShellEL.java
  
  Index: TestBeanShellEL.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/test/org/apache/commons/jelly/tags/beanshell/TestBeanShellEL.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestBeanShellEL.java	25 Feb 2004 01:31:56 -0000	1.3
  +++ TestBeanShellEL.java	9 Sep 2004 12:07:06 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -35,36 +35,36 @@
     * @version $Revision$
     */
   public class TestBeanShellEL extends TestCase {
  -    
  +
       /** The Log to which logging calls will be made. */
       private static final Log log = LogFactory.getLog( TestBeanShellEL.class );
   
       /** Jelly context */
       protected JellyContext context;
  -    
  +
       /** The factory of Expression objects */
       protected ExpressionFactory factory;
  -    
  -    
  +
  +
       public static void main( String[] args ) {
           TestRunner.run( suite() );
       }
  -    
  +
       public static Test suite() {
           return new TestSuite(TestBeanShellEL.class);
       }
  -    
  +
       public TestBeanShellEL(String testName) {
           super(testName);
       }
  -    
  +
       public void setUp() {
           context = new JellyContext();
           context.setVariable( "foo", "abc" );
           context.setVariable( "bar", new Integer( 123 ) );
           factory = new BeanShellExpressionFactory();
       }
  -    
  +
       public void testEL() throws Exception {
           assertExpression( "foo", "abc" );
           assertExpression( "bar * 2", new Integer( 246 ) );
  @@ -72,13 +72,13 @@
           assertExpression( "bar == 124", Boolean.FALSE );
           assertExpression( "foo.equals( \"abc\" )", Boolean.TRUE );
           assertExpression( "foo.equals( \"xyz\" )", Boolean.FALSE );
  -    }    
  -    
  +    }
  +
       /** Evaluates the given expression text and tests it against the expected value */
       protected void assertExpression( String expressionText, Object expectedValue ) throws
Exception {
           Expression expr = factory.createExpression( expressionText );
           Object value = expr.evaluate( context );
           assertEquals( "Value of expression: " + expressionText, expectedValue, value );
  -    }        
  +    }
   }
   
  
  
  
  1.4       +10 -10    jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpression.java
  
  Index: BeanShellExpression.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpression.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BeanShellExpression.java	25 Feb 2004 01:31:52 -0000	1.3
  +++ BeanShellExpression.java	9 Sep 2004 12:07:06 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -34,26 +34,26 @@
   
       /** The expression */
       private String text;
  -    
  +
       public BeanShellExpression(String text) {
           this.text = text;
       }
   
       // Expression interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public String getExpressionText() {
           return "${" + text + "}";
       }
  -    
  +
       public Object evaluate(JellyContext context) {
           try {
               JellyInterpreter interpreter = new JellyInterpreter();
               interpreter.setJellyContext(context);
  -            
  -            if ( log.isDebugEnabled() ) {            
  +
  +            if ( log.isDebugEnabled() ) {
                   log.debug( "Evaluating beanshell: " + text );
               }
  -            
  +
               return interpreter.eval( text );
           }
           catch (Exception e) {
  
  
  
  1.4       +13 -13    jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/JellyInterpreter.java
  
  Index: JellyInterpreter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/JellyInterpreter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JellyInterpreter.java	25 Feb 2004 01:31:52 -0000	1.3
  +++ JellyInterpreter.java	9 Sep 2004 12:07:06 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -36,17 +36,17 @@
       private static final Log log = LogFactory.getLog( JellyInterpreter.class );
   
       private JellyContext context;
  -    
  +
       public JellyInterpreter() {
       }
   
       public JellyContext getJellyContext() {
           return context;
       }
  -    
  +
       public void setJellyContext(JellyContext context) throws EvalError {
           this.context = context;
  -        
  +
           // now pass in all the variables
           for ( Iterator iter = context.getVariableNames(); iter.hasNext(); ) {
               String name = (String) iter.next();
  @@ -56,21 +56,21 @@
                   set( name, value );
               }
           }
  -        
  -        // lets pass in the Jelly context 
  +
  +        // lets pass in the Jelly context
           set( "context", context );
       }
   
   /*
  -  
  +
       // the following code doesn't work - it seems that
       // all variables must be passed into the Interpreter
       // via set() method
  - 
  +
       public Object get(String name) throws EvalError {
           if ( context != null ) {
               Object answer = context.getVariable( name );
  -            if ( answer != null ) { 
  +            if ( answer != null ) {
                   return answer;
               }
           }
  @@ -79,7 +79,7 @@
   */
   
       /**
  -     * Converts variables to a beanshell allowable format or hides names that 
  +     * Converts variables to a beanshell allowable format or hides names that
        * can't be converted, by returning null.
        * For now lets just turn '.' into '_'
        */
  
  
  
  1.4       +5 -5      jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellTagLibrary.java
  
  Index: BeanShellTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellTagLibrary.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- BeanShellTagLibrary.java	25 Feb 2004 01:31:52 -0000	1.3
  +++ BeanShellTagLibrary.java	9 Sep 2004 12:07:06 -0000	1.4
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -31,7 +31,7 @@
       public BeanShellTagLibrary() {
           registerTag("script", ScriptTag.class);
       }
  -    
  +
       /** Allows derived tag libraries to use their own factory */
       protected ExpressionFactory getExpressionFactory() {
           return expressionFactory;
  
  
  
  1.6       +7 -7      jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/ScriptTag.java
  
  Index: ScriptTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/ScriptTag.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ScriptTag.java	25 Feb 2004 01:31:52 -0000	1.5
  +++ ScriptTag.java	9 Sep 2004 12:07:06 -0000	1.6
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -21,7 +21,7 @@
   import org.apache.commons.jelly.TagSupport;
   import org.apache.commons.jelly.XMLOutput;
   
  -/** 
  +/**
    * A tag which invokes a BeanShell script..
    *
    * @author Jason Horman
  @@ -34,11 +34,11 @@
       }
   
       // Tag interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public void doTag(XMLOutput output) throws JellyTagException {
           try {
               JellyInterpreter interpreter = BeanShellExpressionFactory.getInterpreter(context);
  -        
  +
               // @todo it'd be really nice to create a JellyNameSpace to pass into
               // this method so that any variables declared by beanshell could be exported
               // into the JellyContext
  
  
  
  1.5       +14 -14    jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpressionFactory.java
  
  Index: BeanShellExpressionFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/beanshell/src/java/org/apache/commons/jelly/tags/beanshell/BeanShellExpressionFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BeanShellExpressionFactory.java	25 Feb 2004 01:31:52 -0000	1.4
  +++ BeanShellExpressionFactory.java	9 Sep 2004 12:07:06 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -33,30 +33,30 @@
        * A helper method to return the JellyInterpreter for the given JellyContext
        */
       public static JellyInterpreter getInterpreter(JellyContext context) throws EvalError
{
  -  
  -        /** 
  +
  +        /**
            * @todo when we can unify the BeanShell and Jelly variable scopes we can share
a single
  -         * BeanShell context for each JellyContext. 
  +         * BeanShell context for each JellyContext.
            * For now lets create a new one each time, which is slower.
            */
           JellyInterpreter interpreter = new JellyInterpreter();
           interpreter.setJellyContext(context);
           return interpreter;
  -/*        
  -        JellyInterpreter interpreter 
  +/*
  +        JellyInterpreter interpreter
               = (JellyInterpreter) context.getVariable( "org.apache.commons.jelly.beanshell.JellyInterpreter"
);
           if ( interpreter == null ) {
               interpreter = new JellyInterpreter();
               interpreter.setJellyContext(context);
               context.setVariable( "org.apache.commons.jelly.beanshell.JellyInterpreter",
interpreter );
  -        }            
  +        }
           return interpreter;
  -*/        
  +*/
       }
  -    
  -    
  +
  +
       // ExpressionFactory interface
  -    //------------------------------------------------------------------------- 
  +    //-------------------------------------------------------------------------
       public Expression createExpression(String text) throws JellyException {
           return new BeanShellExpression(text);
       }
  
  
  
  1.5       +6 -6      jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/BetwixtTagLibrary.java
  
  Index: BetwixtTagLibrary.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/BetwixtTagLibrary.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BetwixtTagLibrary.java	25 Feb 2004 01:31:51 -0000	1.4
  +++ BetwixtTagLibrary.java	9 Sep 2004 12:07:06 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -17,15 +17,15 @@
   
   import org.apache.commons.jelly.TagLibrary;
   
  -/** 
  - * A Jelly custom tag library that uses the Betwixt project to parse XML and turn it into
beans or 
  +/**
  + * A Jelly custom tag library that uses the Betwixt project to parse XML and turn it into
beans or
    * turn beans into XML
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @version $Revision$
    */
   public class BetwixtTagLibrary extends TagLibrary {
  -        
  +
       public BetwixtTagLibrary() {
           registerTag( "parse", ParseTag.class );
           registerTag( "introspector", IntrospectorTag.class );
  
  
  
  1.8       +30 -30    jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/IntrospectorTag.java
  
  Index: IntrospectorTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/IntrospectorTag.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IntrospectorTag.java	25 Feb 2004 01:31:51 -0000	1.7
  +++ IntrospectorTag.java	9 Sep 2004 12:07:06 -0000	1.8
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -32,7 +32,7 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  -/** 
  +/**
    * Creates a Betwixt XMLIntrospector instance that can be used by the other Betwixt tags.</p>
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -45,11 +45,11 @@
   
       private XMLIntrospector introspector;
       private String var;
  -    
  +
       static {
   
           // register converters to standard Strategies
  -        ConvertUtils.register( 
  +        ConvertUtils.register(
               new Converter() {
                   public Object convert(Class type, Object value) {
                       if ( value instanceof String ) {
  @@ -59,9 +59,9 @@
                           return null;
                       }
                       else {
  -                        throw new ConversionException( 
  -                            "Don't know how to convert: " + value 
  -                            + " of type: " + value.getClass().getName() 
  +                        throw new ConversionException(
  +                            "Don't know how to convert: " + value
  +                            + " of type: " + value.getClass().getName()
                               + " into a NameMapper"
                           );
                       }
  @@ -72,29 +72,29 @@
       }
   
   
  -    
  +
       public IntrospectorTag() {
       }
   
       // Tag interface
  -    //-------------------------------------------------------------------------       
            
  +    //-------------------------------------------------------------------------
       public void doTag(final XMLOutput output) throws MissingAttributeException, JellyTagException
{
   
           if ( var == null ) {
               throw new MissingAttributeException( "var" );
           }
  -        invokeBody(output);        
  -        
  +        invokeBody(output);
  +
           XMLIntrospector introspector = getIntrospector();
  -        
  +
           context.setVariable( var, introspector );
  -        
  +
           // now lets clear this introspector so that its recreated again next time
           this.introspector = null;
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------       
            
  +    //-------------------------------------------------------------------------
   
       /**
        * @return the current XMLIntrospector, lazily creating one if required
  @@ -105,7 +105,7 @@
           }
           return introspector;
       }
  -    
  +
       /**
        * Sets whether attributes or elements should be used for primitive types.
        * The default is false.
  @@ -116,23 +116,23 @@
   
       /**
        * Sets the name mapper used for element names.
  -     * You can also use the Strings 'lowercase', 'uppercase' or 'hyphenated' 
  +     * You can also use the Strings 'lowercase', 'uppercase' or 'hyphenated'
        * as aliases to the common name mapping strategies or specify a class name String.
        */
       public void setElementNameMapper(NameMapper nameMapper) {
           getIntrospector().setElementNameMapper(nameMapper);
       }
  -            
  +
       /**
        * Sets the name mapper used for attribute names.
  -     * You can also use the Strings 'lowercase', 'uppercase' or 'hyphenated' 
  +     * You can also use the Strings 'lowercase', 'uppercase' or 'hyphenated'
        * as aliases to the common name mapping strategies or specify a class name String.
        */
       public void setAttributeNameMapper(NameMapper nameMapper) {
           getIntrospector().setAttributeNameMapper(nameMapper);
       }
  -            
  -    
  +
  +
       /**
        * Sets the variable name to output the new XMLIntrospector to.
        * If this attribute is not specified then this tag must be nested
  @@ -143,8 +143,8 @@
       }
   
       // Implementation methods
  -    //-------------------------------------------------------------------------       
            
  -    
  +    //-------------------------------------------------------------------------
  +
       /**
        * Static helper method which will convert the given string into
        * standard named strategies such as 'lowercase', 'uppercase' or 'hyphenated'
  @@ -169,7 +169,7 @@
               catch (Exception e) {
                   throw new ConversionException( "Could not load class called: " + name,
e );
               }
  -            
  +
               Object object = null;
               try {
                   object = theClass.newInstance();
  @@ -184,14 +184,14 @@
                   throw new ConversionException( "No NameMapper created for type: " + name
);
               }
               else {
  -                throw new ConversionException( 
  -                    "Created object: " + object 
  -                    + " is not a NameMapper! Its type is: " + object.getClass().getName()

  +                throw new ConversionException(
  +                    "Created object: " + object
  +                    + " is not a NameMapper! Its type is: " + object.getClass().getName()
                   );
               }
           }
       }
  -    
  +
       /**
        * Factory method to create a new XMLIntrospector
        */
  
  
  
  1.7       +31 -31    jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/ParseTag.java
  
  Index: ParseTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/betwixt/src/java/org/apache/commons/jelly/tags/betwixt/ParseTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ParseTag.java	25 Feb 2004 01:31:51 -0000	1.6
  +++ ParseTag.java	9 Sep 2004 12:07:06 -0000	1.7
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -32,7 +32,7 @@
   
   import org.xml.sax.SAXException;
   
  -/** 
  +/**
    * Parses some XML specified via the given URI (which can be relative or an absolute URL)
and outputs the
    * parsed object. Typically this tag is customized by setting the introspector attribute
or nesting a child
    * introspector tag inside it.</p>
  @@ -55,13 +55,13 @@
       private XMLIntrospector introspector;
       private boolean useContextClassLoader;
       private ClassLoader classLoader;
  -    
  -    
  +
  +
       public ParseTag() {
       }
   
       // Tag interface
  -    //-------------------------------------------------------------------------       
            
  +    //-------------------------------------------------------------------------
       public void doTag(final XMLOutput output) throws MissingAttributeException, JellyTagException
{
           if ( var == null ) {
               throw new MissingAttributeException( "var" );
  @@ -69,9 +69,9 @@
           if ( rootClass == null ) {
               throw new MissingAttributeException( "rootClass" );
           }
  -        
  +
           reader.setXMLIntrospector(getIntrospector());
  -        
  +
           Class theClass = null;
           try {
               theClass = getClassLoader().loadClass( rootClass );
  @@ -79,12 +79,12 @@
           catch (Exception e) {
               throw new JellyTagException( "Could not load class called: " + rootClass, e
);
           }
  -        
  +
           if ( theClass == null ) {
               throw new JellyTagException( "Could not load class called: " + rootClass );
           }
   
  -        try {       
  +        try {
               if ( path != null ) {
                   reader.registerBeanClass( path, theClass );
               }
  @@ -95,11 +95,11 @@
           catch (IntrospectionException e) {
               throw new JellyTagException(e);
           }
  -        
  +
           Object value = null;
           if ( uri != null ) {
               invokeBody(output);
  -        
  +
               try {
                   URL url = context.getResource( uri );
                   value = reader.parse( url.toString() );
  @@ -113,16 +113,16 @@
   
               // invoke the body and pass that into the reader
               XMLOutput newOutput = new XMLOutput( reader );
  -            
  +
               invokeBody(newOutput);
  -            
  +
               value = reader.getRoot();
           }
           context.setVariable( var, value );
       }
  -    
  +
       // Properties
  -    //-------------------------------------------------------------------------       
            
  +    //-------------------------------------------------------------------------
   
       /**
        * @return the introspector to be used, lazily creating one if required.
  @@ -134,13 +134,13 @@
           return introspector;
       }
       /**
  -     * Sets the Betwixt XMLIntrospector instance used to define the metadata for how a

  +     * Sets the Betwixt XMLIntrospector instance used to define the metadata for how a
        * bean should appear as XML.
        */
       public void setIntrospector(XMLIntrospector introspector) {
           this.introspector = introspector;
       }
  -    
  +
       /**
        * Sets the URI from which XML is parsed. This can be relative to this Jelly script,
use
        * an absolute URI or a full URL
  @@ -148,30 +148,30 @@
       public void setUri(String uri) {
           this.uri = uri;
       }
  -    
  +
       /**
        * Sets the variable name to output with the result of the XML parse.
        */
       public void setVar(String var) {
           this.var = var;
       }
  -    
  +
       /**
        * Sets the name of the root class to use for parsing the XML
        */
       public void setRootClass(String rootClass) {
           this.rootClass = rootClass;
       }
  -    
  +
       /**
  -     * Sets the path that the root class should be bound to. 
  +     * Sets the path that the root class should be bound to.
        * This is optional and often unnecessary though can be used to ignore some wrapping
        * elements, such as the &lt;rss&gt; element in the RSS unit test.
        */
       public void setPath(String path) {
           this.path = path;
       }
  -    
  +
   
       /**
        * Sets whether or not the current threads's context class loader
  @@ -181,22 +181,22 @@
        */
       public void setUseContextClassLoader(boolean useContextClassLoader) {
           this.useContextClassLoader = useContextClassLoader;
  -    }    
  +    }
   
       /**
        * Sets the ClassLoader to be used to load bean classes from.
        * If this is not specified then either the ClassLoader used to load this tag library
  -     * is used or, if the 'useContextClassLoader' property is true, then the 
  +     * is used or, if the 'useContextClassLoader' property is true, then the
        * current threads context class loader is used instead.
  -     */    
  +     */
       public void setClassLoader(ClassLoader classLoader) {
           this.classLoader = classLoader;
       }
  -    
  -    
  +
  +
       // Implementation methods
  -    //-------------------------------------------------------------------------       
            
  -    
  +    //-------------------------------------------------------------------------
  +
       /**
        * @return the ClassLoader to be used to load bean classes.
        */
  
  
  
  1.5       +6 -6      jakarta-commons/jelly/jelly-tags/betwixt/src/test/org/apache/commons/jelly/betwixt/TestJelly.java
  
  Index: TestJelly.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/jelly/jelly-tags/betwixt/src/test/org/apache/commons/jelly/betwixt/TestJelly.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestJelly.java	25 Feb 2004 01:32:00 -0000	1.4
  +++ TestJelly.java	9 Sep 2004 12:07:06 -0000	1.5
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2002,2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
  - * 
  + *
    *      http://www.apache.org/licenses/LICENSE-2.0
  - * 
  + *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  @@ -20,7 +20,7 @@
   
   import org.apache.commons.jelly.tags.junit.JellyTestSuite;
   
  -/** 
  +/**
    * A helper class to run jelly test cases as part of Ant's JUnit tests
    *
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  @@ -31,8 +31,8 @@
       public static void main( String[] args ) throws Exception {
           TestRunner.run( suite() );
       }
  -    
  +
       public static TestSuite suite() throws Exception {
  -        return createTestSuite(TestJelly.class, "suite.jelly");        
  +        return createTestSuite(TestJelly.class, "suite.jelly");
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message