ClojureModelWriter extends ModelWriterSupport { public void write(Writer writer, Map<String, Object> stringObjectMap, Model model) throws IOException { try { final Var REQUIRE = Var.intern(RT.CLOJURE_NS, Symbol.create("require")); final Symbol REFLECTOR = Symbol.create("org.sonatype.maven.polyglot.clojure.dsl.writer"); REQUIRE.invoke(REFLECTOR); final Var WRITER = Var.intern(Namespace.findOrCreate(REFLECTOR), Symbol.create("write-model")); WRITER.invoke(model, writer); } catch (Exception e) { e.printStackTrace(); throw (IOException) new IOException(e.toString()).initCause(e); } }  void write(Writer writer, Map<String, Object> stringObjectMap, Model model);  }
@Test public void testModelPrinting() throws Exception { Model model = readClojureModel("test1.clj"); assertNotNull(model); ClojureModelWriter writer = new ClojureModelWriter(); StringWriter sw = new StringWriter(); writer.write(sw, new HashMap(), model); System.out.println(sw.getBuffer().toString()); }