2014-09-10 52 views
0

在NetBeans平台。使模块的XML层可见我有一个模块观看XML文件系统和应对时,它的其他模块改变其他模块

我在另一个模块中创建了一个layer.xml。在观看模块中,当我点击XML层节点并打开时,IDE中会显示更改。然而,在运行时,当监视模块正在查看xml文件系统时,来自其他模块的更改不存在。其他模块可以在运行期间看到它自己的变化。

是否有设置某处一个模块,可让其他模块看到它的XML层?

这是我使用的检查运行时的XML文件系统的代码 - 它打印的所有节点的名称到一个文件,我触发它从一个按钮时,所有模块都是开放式运行。

private void btn1ActionPerformed(java.awt.event.ActionEvent evt)          
{          
    try { 
     BufferedWriter writer = Files.newBufferedWriter(Paths.get("filesystemOut.txt"), Charset.forName("UTF-8")); 
     exportFilesystem(FileUtil.getConfigRoot(), writer, 0); 
     writer.close(); 
    } catch (IOException e) { 
     System.err.println("couldn't write filesystem structure"); 
    } 
} 

void exportFilesystem(FileObject root, BufferedWriter writer, int depth) throws IOException 
{ 
    for (int i = 0; i < depth * 4; ++i) 
    { 
     writer.write(' '); 
    } 
    writer.write(root.getName()); 
    writer.newLine(); 
    FileObject[] children = root.getChildren(); 
    for (FileObject child : children) 
    { 
     exportFilesystem(child, writer, depth + 1); 
    } 
}  

回答

1

打开需要可见的xml层的模块的属性对话框。选择API Versioning并在Public packages下选择包含xml文件的包。点击OK