Java ROME如何确定是否在提要上使用了自定义模块?

Java ROME如何确定是否在提要上使用了自定义模块?,java,rss,rome,Java,Rss,Rome,我目前正在使用ROME进行播客提要的RSS处理。目前,这些提要可以用不同的方式组合。(Itunes提要模式中有一个例外) 自定义提要读取如何与Rome一起工作,Rome是否会自动将提要/条目对象转换为ITunes comptabable数据对象?有这样的例子吗?是的,如果您的类路径中有元数据模块,Rome将自动为您提供元数据模块: SyndFeed feed = .. for(SyndEntry entry : feed.getEntries()) { for (Module modul

我目前正在使用ROME进行播客提要的RSS处理。目前,这些提要可以用不同的方式组合。(Itunes提要模式中有一个例外)


自定义提要读取如何与Rome一起工作,Rome是否会自动将提要/条目对象转换为ITunes comptabable数据对象?有这样的例子吗?

是的,如果您的类路径中有元数据模块,Rome将自动为您提供元数据模块:

SyndFeed feed = ..
for(SyndEntry entry : feed.getEntries()) {
    for (Module module : entry.getModules()) {
        System.out.println(module.getClass());

        if (module instanceof EntryInformation) {
            EntryInformation itunesEntry = (EntryInformation)module;
            ..
        }
    }
}
例如,这将打印出来

class com.rometools.rome.feed.module.DCModuleImpl
class com.rometools.modules.content.ContentModuleImpl
class com.rometools.modules.slash.SlashImpl
class com.rometools.modules.itunes.EntryInformationImpl

是的,如果您的类路径中有以下内容,Rome将自动为您提供元数据模块:

SyndFeed feed = ..
for(SyndEntry entry : feed.getEntries()) {
    for (Module module : entry.getModules()) {
        System.out.println(module.getClass());

        if (module instanceof EntryInformation) {
            EntryInformation itunesEntry = (EntryInformation)module;
            ..
        }
    }
}
例如,这将打印出来

class com.rometools.rome.feed.module.DCModuleImpl
class com.rometools.modules.content.ContentModuleImpl
class com.rometools.modules.slash.SlashImpl
class com.rometools.modules.itunes.EntryInformationImpl