fileedit fixed
[mir.git] / source / mir / util / GeneratorHTMLFunctions.java
index 661ff56..bcedf17 100755 (executable)
@@ -30,7 +30,6 @@
 package mir.util;
 
 import java.util.List;
-import java.io.*;
 
 import mir.generator.Generator;
 import mir.generator.GeneratorExc;
@@ -78,6 +77,23 @@ public class GeneratorHTMLFunctions {
     };
   }
 
+  public static class prettyEncodeHTMLGeneratorFunction implements Generator.GeneratorFunction {
+    public Object perform(List aParameters) throws GeneratorExc {
+      try {
+        if (aParameters.size()!=1)
+          throw new GeneratorExc("prettyEncodeHTMLGeneratorFunction: only 1 parameter expected");
+
+        return HTMLRoutines.prettyEncodeHTML(StringRoutines.interpretAsString(aParameters.get(0)));
+      }
+      catch (GeneratorExc e) {
+        throw e;
+      }
+      catch (Throwable t) {
+        throw new GeneratorFailure("prettyEncodeHTMLGeneratorFunction: " + t.getMessage(), t);
+      }
+    };
+  }
+
   public static class encodeXMLGeneratorFunction implements Generator.GeneratorFunction {
     public Object perform(List aParameters) throws GeneratorExc {
       try {