Top Fields Constructors Methods
com.rometools.rome.io.impl

public abstract Class BaseWireFeedGenerator

extends Object
implements WireFeedGenerator
Class Inheritance
All Implemented Interfaces
com.rometools.rome.io.WireFeedGenerator
Known Direct Subclasses
com.rometools.rome.io.impl.RSS090Generator, com.rometools.rome.io.impl.Atom03Generator, com.rometools.rome.io.impl.Atom10Generator
Imports
java.util.ArrayList, .HashSet, .List, .Set, org.jdom2.Element, .Namespace, .Parent, com.rometools.rome.feed.module.Module, com.rometools.rome.io.WireFeedGenerator

Field Summary

Modifier and TypeField and Description
private final Namespace[]
private static final String
FEED_MODULE_GENERATORS_POSFIX_KEY

[TYPE].feed.ModuleParser.classes= [className] ...

private final ModuleGenerators
private static final String
ITEM_MODULE_GENERATORS_POSFIX_KEY

[TYPE].item.ModuleParser.classes= [className] ...

private final ModuleGenerators
private static final String
PERSON_MODULE_GENERATORS_POSFIX_KEY

[TYPE].person.ModuleParser.classes= [className] ...

private final ModuleGenerators
private final String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
private static void
collectUsedPrefixes(final Element el, final Set<String> collector)

protected void
generateFeedModules(final List<Module> modules, final Element feed)

protected void
generateForeignMarkup(final Element element, final List<Element> foreignElements)

public void
generateItemModules(final List<Module> modules, final Element item)

protected void
public void
generatePersonModules(final List<Module> modules, final Element person)

public String
getType()

Implements com.rometools.rome.io.WireFeedGenerator.getType.

Returns the type of feed the generator creates.
protected static void
purgeUnusedNamespaceDeclarations(final Element root)

Purging unused declarations is less optimal, performance-wise, than never adding them in the first place.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

allModuleNamespacesback to summary
private final Namespace[] allModuleNamespaces
FEED_MODULE_GENERATORS_POSFIX_KEYback to summary
private static final String FEED_MODULE_GENERATORS_POSFIX_KEY

[TYPE].feed.ModuleParser.classes= [className] ...

feedModuleGeneratorsback to summary
private final ModuleGenerators feedModuleGenerators
ITEM_MODULE_GENERATORS_POSFIX_KEYback to summary
private static final String ITEM_MODULE_GENERATORS_POSFIX_KEY

[TYPE].item.ModuleParser.classes= [className] ...

itemModuleGeneratorsback to summary
private final ModuleGenerators itemModuleGenerators
PERSON_MODULE_GENERATORS_POSFIX_KEYback to summary
private static final String PERSON_MODULE_GENERATORS_POSFIX_KEY

[TYPE].person.ModuleParser.classes= [className] ...

personModuleGeneratorsback to summary
private final ModuleGenerators personModuleGenerators
typeback to summary
private final String type

Constructor Detail

BaseWireFeedGeneratorback to summary
protected BaseWireFeedGenerator(final String type)

Method Detail

collectUsedPrefixesback to summary
private static void collectUsedPrefixes(final Element el, final Set<String> collector)
generateFeedModulesback to summary
protected void generateFeedModules(final List<Module> modules, final Element feed)
generateForeignMarkupback to summary
protected void generateForeignMarkup(final Element element, final List<Element> foreignElements)
generateItemModulesback to summary
public void generateItemModules(final List<Module> modules, final Element item)
generateModuleNamespaceDefsback to summary
protected void generateModuleNamespaceDefs(final Element root)
generatePersonModulesback to summary
public void generatePersonModules(final List<Module> modules, final Element person)
getTypeback to summary
public String getType()

Implements com.rometools.rome.io.WireFeedGenerator.getType.

Doc from com.rometools.rome.io.WireFeedGenerator.getType.

Returns the type of feed the generator creates.

Returns:String

the type of feed the generator creates.

Annotations
@Override
purgeUnusedNamespaceDeclarationsback to summary
protected static void purgeUnusedNamespaceDeclarations(final 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.