Package com.rometools.rome.io.impl
Class DCModuleGenerator
- java.lang.Object
-
- com.rometools.rome.io.impl.DCModuleGenerator
-
- All Implemented Interfaces:
ModuleGenerator
public class DCModuleGenerator extends Object implements ModuleGenerator
Feed Generator for DublinCore Module.
-
-
Constructor Summary
Constructors Constructor Description DCModuleGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerate(Module module, org.jdom2.Element element)Populate an element tree with elements for a module.protected org.jdom2.ElementgenerateSimpleElement(String name, String value)Utility method to generate a single element containing a string.protected List<org.jdom2.Element>generateSimpleElementList(String name, List<String> values)Utility method to generate a list of simple elements.protected org.jdom2.ElementgenerateSubjectElement(DCSubject subject)Utility method to generate an element for a subject.Set<org.jdom2.Namespace>getNamespaces()Returns a set with all the URIs (JDOM Namespace elements) this module generator uses.StringgetNamespaceUri()Returns the namespace URI this generator handles.
-
-
-
Method Detail
-
getNamespaceUri
public final String getNamespaceUri()
Description copied from interface:ModuleGeneratorReturns the namespace URI this generator handles.- Specified by:
getNamespaceUriin interfaceModuleGenerator- Returns:
- the namespace URI.
-
getNamespaces
public final Set<org.jdom2.Namespace> getNamespaces()
Returns a set with all the URIs (JDOM Namespace elements) this module generator uses. It is used by the the feed generators to add their namespace definition in the root element of the generated document (forward-missing of Java 5.0 Generics).- Specified by:
getNamespacesin interfaceModuleGenerator- Returns:
- a set with all the URIs this module generator uses.
-
generate
public final void generate(Module module, org.jdom2.Element element)
Populate an element tree with elements for a module.- Specified by:
generatein interfaceModuleGenerator- Parameters:
module- the module to populate from.element- the root element to attach child elements to.
-
generateSubjectElement
protected final org.jdom2.Element generateSubjectElement(DCSubject subject)
Utility method to generate an element for a subject.- Parameters:
subject- the subject to generate an element for.- Returns:
- the element for the subject.
-
generateSimpleElement
protected final org.jdom2.Element generateSimpleElement(String name, String value)
Utility method to generate a single element containing a string.- Parameters:
name- the name of the elment to generate.value- the value of the text in the element.- Returns:
- the element generated.
-
generateSimpleElementList
protected final List<org.jdom2.Element> generateSimpleElementList(String name, List<String> values)
Utility method to generate a list of simple elements.- Parameters:
name- the name of the element list to generate.values- the list of values for the elements.- Returns:
- a list of Elements created.
-
-