package it.newinstance.util.rtf; public class Sample { public static void main(String[] args) throws Exception { String resourceName = "/sample-module.rtf"; RTF rtf = new RTF(Sample.class.getResourceAsStream(resourceName)); if (!rtf.set("name", "Foo")) System.out.println("name not found"); if (!rtf.set("surname", "Bar")) System.out.println("surname not found"); if (!rtf.set("birthday", "10/10/2010")) System.out.println("birthday not found"); if (!rtf.set("address", "Sample Test Address")) System.out.println("address not found"); if (!rtf.set("phone", "+010 010101010")) System.out.println("phone not found"); if (!rtf.set("phone", "this should fail")) System.out.println("phone not found"); // this should be printed if (!rtf.set("test", "testtesttest")) System.out.println("test not found"); // this should be printed rtf.open(); } }