com.sun.syndication.io.impl
Class DCModuleGenerator

java.lang.Object
  extended by com.sun.syndication.io.impl.DCModuleGenerator
All Implemented Interfaces:
ModuleGenerator

public class DCModuleGenerator
extends Object
implements ModuleGenerator

Feed Generator for DublinCore Module.

Author:
Elaine Chien

Constructor Summary
DCModuleGenerator()
           
 
Method Summary
 void generate(Module module, org.jdom2.Element element)
          Populate an element tree with elements for a module.
protected  org.jdom2.Element generateSimpleElement(String name, String value)
          Utility method to generate a single element containing a string.
protected  List<org.jdom2.Element> generateSimpleElementList(String name, List<String> value)
          Utility method to generate a list of simple elements.
protected  org.jdom2.Element generateSubjectElement(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.
 String getNamespaceUri()
          Returns the namespace URI this generator handles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DCModuleGenerator

public DCModuleGenerator()
Method Detail

getNamespaceUri

public final String getNamespaceUri()
Description copied from interface: ModuleGenerator
Returns the namespace URI this generator handles.

Specified by:
getNamespaceUri in interface ModuleGenerator
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:
getNamespaces in interface ModuleGenerator
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:
generate in interface ModuleGenerator
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> value)
Utility method to generate a list of simple elements.

Parameters:
name - the name of the element list to generate.
value - the list of values for the elements.
Returns:
a list of Elements created.


Copyright © 2004–2013 ROME Project. All rights reserved.