avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject svn commit: rev 21122 - in avalon/trunk/tools/magic: engine/src/java/org/apache/avalon/magic junit junit/src test
Date Sat, 12 Jun 2004 08:33:45 GMT
Author: niclas
Date: Sat Jun 12 01:33:44 2004
New Revision: 21122

Added:
   avalon/trunk/tools/magic/junit/
      - copied from rev 21119, avalon/trunk/tools/magic/test/
   avalon/trunk/tools/magic/junit/magic.properties
      - copied unchanged from rev 21121, avalon/trunk/tools/magic/test/magic.properties
   avalon/trunk/tools/magic/junit/src/
      - copied from rev 21121, avalon/trunk/tools/magic/test/src/
Removed:
   avalon/trunk/tools/magic/test/
Modified:
   avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/DefaultResolver.java
   avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginContext.java
   avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginProperties.java
   avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PropertyResolver.java
Log:
Fixed the compile problems, that were pending during the last commit.

Modified: avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/DefaultResolver.java
==============================================================================
--- avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/DefaultResolver.java
(original)
+++ avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/DefaultResolver.java
Sat Jun 12 01:33:44 2004
@@ -17,11 +17,15 @@
 
 package org.apache.avalon.magic;
 
+import java.util.Stack;
+import java.util.StringTokenizer;
+
+
 public class DefaultResolver
     implements PropertyResolver
 {
 
-    public String resolve( String value )
+    public String resolve( PluginProperties props, String value )
     {
         // optimization for common case.
         int pos1 = value.indexOf( "${" );
@@ -40,7 +44,7 @@
                 String open = (String) stack.pop();
                 if( open.equals( "${" ) )
                 {
-                    String propValue = getProperty( name );
+                    String propValue = props.getProperty( name );
                     if( propValue == null )
                         push( stack, "${" + name + "}" );
                     else
@@ -89,4 +93,4 @@
             stack.push( value );
         }
     }
-}
\ No newline at end of file
+}

Modified: avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginContext.java
==============================================================================
--- avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginContext.java	(original)
+++ avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginContext.java	Sat
Jun 12 01:33:44 2004
@@ -202,6 +202,6 @@
     
     public String resolve( String value )
     {
-        return m_ProjectProperties.resolve( value );
+        return new DefaultResolver().resolve( m_ProjectProperties, value );
     }
 }

Modified: avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginProperties.java
==============================================================================
--- avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginProperties.java
(original)
+++ avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PluginProperties.java
Sat Jun 12 01:33:44 2004
@@ -20,13 +20,14 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Stack;
-import java.util.StringTokenizer;
 
 public class PluginProperties extends Properties
 {
+    private PropertyResolver m_Resolver;
+    
     PluginProperties()
     {
+        m_Resolver = new DefaultResolver();
     }
     
     PluginProperties( Properties content )
@@ -49,17 +50,12 @@
         if( value == null )
             return null;
         value = value.trim();
-        return resolver.resolve( value );
+        return resolver.resolve( this, value );
     }
     
     public String getProperty( String name )
     {
-        name = name.trim();
-        String value = super.getProperty( name );
-        if( value == null )
-            return null;
-        value = value.trim();
-        return resolve( value );
+        return getProperty( name, m_Resolver );
     }
     
-}
\ No newline at end of file
+}

Modified: avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PropertyResolver.java
==============================================================================
--- avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PropertyResolver.java
(original)
+++ avalon/trunk/tools/magic/engine/src/java/org/apache/avalon/magic/PropertyResolver.java
Sat Jun 12 01:33:44 2004
@@ -19,5 +19,5 @@
 
 public interface PropertyResolver
 {
-    String resolve( String value );
-}
\ No newline at end of file
+    String resolve( PluginProperties props, String value );
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org


Mime
View raw message