onami-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1463275 - /incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java
Date Mon, 01 Apr 2013 20:09:41 GMT
Author: simonetripodi
Date: Mon Apr  1 20:09:41 2013
New Revision: 1463275

URL: http://svn.apache.org/r1463275
Log:
[ONAMI-106] #comment added APIs to allow user plug the custom Parse instance #resolve

Modified:
    incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java

Modified: incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java
URL: http://svn.apache.org/viewvc/incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java?rev=1463275&r1=1463274&r2=1463275&view=diff
==============================================================================
--- incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java
(original)
+++ incubator/onami/trunk/configuration/src/main/java/org/apache/onami/configuration/Rocoto.java
Mon Apr  1 20:09:41 2013
@@ -27,6 +27,8 @@ import static java.util.Arrays.asList;
 import java.util.List;
 import java.util.Map.Entry;
 
+import org.apache.onami.configuration.variables.AntStyleParser;
+import org.apache.onami.configuration.variables.Parser;
 import org.apache.onami.configuration.variables.VariablesMap;
 
 import com.google.inject.AbstractModule;
@@ -50,27 +52,54 @@ public final class Rocoto
         return expandVariables( asList( baseModules ) );
     }
 
+    /**
+     *
+     * @param parser
+     * @param baseModules
+     * @return
+     * @since 6.3.0
+     */
+    public static Module expandVariables( Parser parser, Module...baseModules )
+    {
+        return expandVariables( parser, asList( baseModules ) );
+    }
+
     public static Module expandVariables( Iterable<? extends Module> baseModules )
     {
-        return override( baseModules ).with( new Rocoto( getElements( baseModules ) ) );
+        return expandVariables( new AntStyleParser(), baseModules );
+    }
+
+    /**
+     *
+     * @param parser
+     * @param baseModules
+     * @return
+     * @since 6.3.0
+     */
+    public static Module expandVariables( Parser parser, Iterable<? extends Module>
baseModules )
+    {
+        return override( baseModules ).with( new Rocoto( parser, getElements( baseModules
) ) );
     }
 
     private final TypeLiteral<String> stringLiteral = new TypeLiteral<String>(){};
 
+    private final Parser parser;
+
     private final List<Element> elements;
 
     /**
      * Do nothing, this class cannot be instantiated
      */
-    private Rocoto( List<Element> elements )
+    private Rocoto( Parser parser, List<Element> elements )
     {
+        this.parser = parser;
         this.elements = elements;
     }
 
     @Override
     protected void configure()
     {
-        final VariablesMap variablesMap = new VariablesMap();
+        final VariablesMap variablesMap = new VariablesMap( parser );
 
         for ( final Element element : elements )
         {



Mime
View raw message