Package com.rometools.rome.io.impl
Class BaseWireFeedGenerator
- java.lang.Object
-
- com.rometools.rome.io.impl.BaseWireFeedGenerator
-
- All Implemented Interfaces:
WireFeedGenerator
- Direct Known Subclasses:
Atom03Generator,Atom10Generator,RSS090Generator
public abstract class BaseWireFeedGenerator extends Object implements WireFeedGenerator
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseWireFeedGenerator(String type)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidgenerateFeedModules(List<Module> modules, org.jdom2.Element feed)protected voidgenerateForeignMarkup(org.jdom2.Element element, List<org.jdom2.Element> foreignElements)voidgenerateItemModules(List<Module> modules, org.jdom2.Element item)protected voidgenerateModuleNamespaceDefs(org.jdom2.Element root)voidgeneratePersonModules(List<Module> modules, org.jdom2.Element person)StringgetType()Returns the type of feed the generator creates.protected static voidpurgeUnusedNamespaceDeclarations(org.jdom2.Element root)Purging unused declarations is less optimal, performance-wise, than never adding them in the first place.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.rometools.rome.io.WireFeedGenerator
generate
-
-
-
-
Constructor Detail
-
BaseWireFeedGenerator
protected BaseWireFeedGenerator(String type)
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:WireFeedGeneratorReturns the type of feed the generator creates.- Specified by:
getTypein interfaceWireFeedGenerator- Returns:
- the type of feed the generator creates.
- See Also:
for details on the format of this string.
-
generateModuleNamespaceDefs
protected void generateModuleNamespaceDefs(org.jdom2.Element root)
-
generateFeedModules
protected void generateFeedModules(List<Module> modules, org.jdom2.Element feed)
-
generatePersonModules
public void generatePersonModules(List<Module> modules, org.jdom2.Element person)
-
generateForeignMarkup
protected void generateForeignMarkup(org.jdom2.Element element, List<org.jdom2.Element> foreignElements)
-
purgeUnusedNamespaceDeclarations
protected static void purgeUnusedNamespaceDeclarations(org.jdom2.Element root)
Purging unused declarations is less optimal, performance-wise, than never adding them in the first place. So, we should still ask the ROME guys to fix their code (not adding dozens of unnecessary module declarations). Having said that: purging them here, before XML generation, is more efficient than parsing and re-molding the XML after ROME generates it. Note that the calling app could still add declarations/modules to the Feed tree after this. Which is fine. But those modules are then responsible for crawling to the root of the tree, at generate() time, to make sure their namespace declarations are present.
-
-