Package org.apache.clerezza.templating.seedsnipe.simpleparser

Examples of org.apache.clerezza.templating.seedsnipe.simpleparser.DefaultParser


    /* without the final access to field it does not work,
    field access in if-conditins does not count for loops*/
    StringReader reader = new StringReader("${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}${loop}${if rdfs:comment}${rdfs:comment}${/if} and ${if rdfs:label}yes${else}no${/if}${rdfs:comment}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"a resource\" and no\"a resource\"", writer.toString());
  }
View Full Code Here


          "${/loop}" +
          "${/loop}";
      StringReader reader = new StringReader(templateString);
      StringWriter writer = new StringWriter();

      new DefaultParser(reader, writer).perform(dataFieldResolver);

      Assert.assertTrue(writer.toString().contains("Martin Poulter") && writer.toString().contains("Kal Ahmed") && writer.toString().contains("Libby Miller"));

    } catch (UnsupportedFormatException e) {
      e.printStackTrace();
View Full Code Here

          "${/loop}" +
          "${/loop}";
      StringReader reader = new StringReader(templateString);
      StringWriter writer = new StringWriter();

      new DefaultParser(reader, writer).perform(dataFieldResolver);


      final String templateResult = writer.toString();
      Assert.assertTrue(templateResult.contains("Martin Poulter"));
      Assert.assertTrue(templateResult.indexOf("Martin Poulter") < templateResult.indexOf("Sarah Miller"));
View Full Code Here

    StringReader reader = new StringReader(
        "${ns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#}" +
        "${loop}${loop}${rdf:value/contains}${/loop}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"first\"\"second\"\"third\"", writer.toString());
  }
View Full Code Here

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);
    StringReader reader = new StringReader(
        "${loop}${./contains}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"first\"\"second\"\"third\"", writer.toString());
  }
View Full Code Here

    StringReader reader = new StringReader(
        "${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}" +
        "${loop}${loop}${contains/rdfs:label}${/loop}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"first\"\"second\"\"third\"", writer.toString());
  }
View Full Code Here

    StringReader reader = new StringReader(
        "${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}" +
        "${loop}${if contains/rdfs:label}${contains/rdfs:label}${/if}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"first\"\"second\"\"third\"", writer.toString());
  }
View Full Code Here

    StringReader reader = new StringReader("${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}" +
        "${if getAudio(\"foo/bar\") = \"audio\"}noproblem${/if}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("noproblem", writer.toString());
  }
View Full Code Here

    StringReader reader = new StringReader(
        "${ns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#}" +
        "${loop}${loop}${rdf:value/contains}${/loop}${/loop}");
    StringWriter writer = new StringWriter();

    new DefaultParser(reader, writer).perform(dataFieldResolver);

    Assert.assertEquals("\"first\"\"second\"\"third\"", writer.toString());
  }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.templating.seedsnipe.simpleparser.DefaultParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.