reintroduced StringUtil.regexpReplace
[mir.git] / source / mir / producer / BundleProducerNode.java
index c86cdaf..4197a82 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001, 2002 The Mir-coders group
+ * Copyright (C) 2001-2006 The Mir-coders group
  *
  * This file is part of Mir.
  *
@@ -19,8 +19,6 @@
  *
  * In addition, as a special exception, The Mir-coders gives permission to link
  * the code of this program with  any library licensed under the Apache Software License,
- * The Sun (tm) Java Advanced Imaging library (JAI), The Sun JIMI library
- * (or with modified versions of the above that use the same license as the above),
  * and distribute linked combinations including the two.  You must obey the
  * GNU General Public License in all respects for all of the code used other than
  * the above mentioned libraries.  If you modify this file, you may extend this
@@ -40,7 +38,7 @@ import mircoders.global.MirGlobal;
 /**
  * This producer node loads a bundle
  */
-public class BundleProducerNode implements ProducerNode {
+public class BundleProducerNode extends AbstractProducerNode {
   private String key;
   private String bundleExpression;
   private String languageExpression;
@@ -55,15 +53,16 @@ public class BundleProducerNode implements ProducerNode {
     key = aKey;
   }
 
-  /** {@inheritDoc} */
+  /** {@inheritDoc} */    
   public void produce(Map aValueMap, String aVerb, LoggerWrapper aLogger) throws ProducerFailure {
     try {
       String bundle = ParameterExpander.expandExpression( aValueMap, bundleExpression );
       String[] languages = new String[0];
-      if (languageExpression!=null)
-        languages = new String[] { ParameterExpander.expandExpression( aValueMap, languageExpression ) };
+      if (languageExpression != null) {
+        languages = new String[]{ParameterExpander.expandExpression(aValueMap, languageExpression)};
+      }
 
-      if (MirGlobal.config().getString("Producer.BundleCompatibility", "0").equals("1") &&
+      if ("1".equals(MirGlobal.config().getString("Producer.BundleCompatibility", "0")) &&
           bundle.startsWith("bundles.")) {
         bundle = "etc/bundles/" + bundle.substring("bundles.".length());
       }
@@ -79,5 +78,4 @@ public class BundleProducerNode implements ProducerNode {
           languageExpression +  " into key " + key + ": " + t.getMessage());
     }
   }
-
 }
\ No newline at end of file