1 19 35 36 import java.io.*; 37 import java.util.*; 38 import org.w3c.dom.*; 39 40 import namespacesample.*; 41 42 43 public class TestNamespace extends BaseTest { 44 public static void main(String [] argv) { 45 TestNamespace o = new TestNamespace(); 46 if (argv.length > 0) 47 o.setDocumentDir(argv[0]); 48 try { 49 o.run(); 50 } catch (Exception e) { 51 e.printStackTrace(); 52 System.exit(1); 53 } 54 System.exit(0); 55 } 56 57 public void run() throws Exception { 58 NamespaceSample namespace; 59 60 this.readDocument(); 61 62 out("creating the bean graph"); 63 namespace = NamespaceSample.read(doc); 64 65 out("bean graph created"); 67 namespace.write(out); 68 69 out("Changed description"); 70 ConfigPropertyType cp = namespace.getConfigProperty(0); 71 cp.setDescription("\"now - birthday\" (units: year)"); 72 namespace.write(out); 73 } 74 } 75 | Popular Tags |