Search in sources :

Example 1 with XStream2PluginInfoReader

use of com.qlangtech.tis.util.XStream2PluginInfoReader in project tis by qlangtech.

the class ComponentMeta method loadPluginMeta.

/**
 * 取得元数据信息
 *
 * @return
 */
public Set<XStream2.PluginMeta> loadPluginMeta() {
    synchronized (RobustReflectionConverter.usedPluginInfo) {
        RobustReflectionConverter.usedPluginInfo.remove();
        XStream2PluginInfoReader reader = new XStream2PluginInfoReader(XmlFile.DEFAULT_DRIVER);
        for (IRepositoryResource res : this.resources) {
            File targetFile = res.getTargetFile();
            if (!targetFile.exists()) {
                // throw new IllegalStateException("file:" + targetFile.getAbsolutePath() + " is not exist");
                continue;
            }
            try {
                XmlFile xmlFile = new XmlFile(reader, targetFile);
                xmlFile.read();
            } catch (IOException e) {
                throw new RuntimeException(targetFile.getAbsolutePath(), e);
            }
        }
        return RobustReflectionConverter.usedPluginInfo.get();
    }
}
Also used : XmlFile(com.qlangtech.tis.extension.impl.XmlFile) IOException(java.io.IOException) XStream2PluginInfoReader(com.qlangtech.tis.util.XStream2PluginInfoReader) XmlFile(com.qlangtech.tis.extension.impl.XmlFile) File(java.io.File)

Aggregations

XmlFile (com.qlangtech.tis.extension.impl.XmlFile)1 XStream2PluginInfoReader (com.qlangtech.tis.util.XStream2PluginInfoReader)1 File (java.io.File)1 IOException (java.io.IOException)1