不打开模块获取属性

问题描述

有没有办法在不读取模块的情况下获取它的属性? 我需要获取大约 100 个模块的信息,如果我必须阅读每个模块需要 10 多分钟

我不需要实际获取对象,只需获取模块中可用的属性

解决方法

ModuleProperties 应该更快。试试这样:

Item i = null
ModuleProperties mp = null
string sModuleAttribute = ""
string sError = ""
for i in project "/<myproject>" do {
    if (type i == "Formal") {
        sError = getProperties (moduleVersion module fullName i,mp)
        if (null sError) {
            for sModuleAttribute in mp do {
                print fullName i "\t" sModuleAttribute "\t" mp.sModuleAttribute "\n"
            }
        } else {print sError "\n"}
        delete mp
    }
}

如果您也对对象的属性定义感兴趣,这可能会有所帮助

Item i = null
ModuleProperties mp = null
AttrDef ad = null
string sError = ""
for i in folder "/<myproject>" do {
    if (type i == "Formal") {
        sError = getProperties (moduleVersion module fullName i,mp)
        if (null sError) {
            for ad in mp do {
                print fullName i "\t" ad.name "\t" ad.typeName "\t" ad.object "\t" ad.module  "\n"
            }
        } else {print sError}
        delete mp
    }
}

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...