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

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


    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

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


    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

    Assert.assertEquals("<http://example.org/subject>", writer.toString());
  }
View Full Code Here

    });

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

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

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

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

    Assert.assertEquals("<http://example.org/>\"a resource\"", writer.toString());
  }
View Full Code Here

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

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

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

    Assert.assertEquals("\"A RESOURCE\"", writer.toString());
  }
View Full Code Here

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

    StringReader reader = new StringReader("${uppercase(\"a string\")}");
    StringWriter writer = new StringWriter();

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

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

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

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

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

    Assert.assertEquals("\"A RESOURCE\"", writer.toString());
  }
View Full Code Here

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

    StringReader reader = new StringReader("Multiple\n${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#} ${loop}\t${rdfs:comment}\n${/loop}");
    StringWriter writer = new StringWriter();

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

    Assert.assertTrue(writer.toString().contains("\"a resource\"") && writer.toString().contains("\"another resource\""));
  }
View Full Code Here

    DataFieldResolver dataFieldResolver = new GraphNodeDataFieldResolver(node, simpleFunctions);

    StringReader reader = new StringReader("${ns:rdfs=http://www.w3.org/2000/01/rdf-schema#}${if rdfs:comment}yes${/if} and ${if rdfs:label}yes${else}no${/if}");
    StringWriter writer = new StringWriter();

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

    Assert.assertEquals("yes and no", 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.