Examples of DCModuleI


Examples of com.sun.syndication.feed.module.DCModuleI

     * Returns the Dublin Core module of the feed.
     * @return the DC module, it's never <b>null</b>
     *
     */
    private DCModuleI getDCModule() {
        DCModuleI dcModule = null;
        List modules = getModules();
        for (int i=0;dcModule==null && i<modules.size();i++) {
            ModuleI module = (ModuleI) modules.get(i);
            if (module.getUri().equals(DCModuleI.URI)) {
                dcModule = (DCModuleI) module;
View Full Code Here

Examples of com.sun.syndication.feed.module.DCModuleI

     * Returns the Dublin Core module of the feed.
     * @return the DC module, it's never <b>null</b>
     *
     */
    private DCModuleI getDCModule() {
        DCModuleI dcModule = null;
        List modules = getModules();
        for (int i=0;dcModule==null && i<modules.size();i++) {
            ModuleI module = (ModuleI) modules.get(i);
            if (module.getUri().equals(DCModuleI.URI)) {
                dcModule = (DCModuleI) module;
View Full Code Here

Examples of com.sun.syndication.feed.module.DCModuleI

     * Returns the Dublin Core module of the entry.
     * @return the DC module, it's never <b>null</b>
     *
     */
    private DCModuleI getDCModule() {
        DCModuleI dcModule = null;
        List modules = getModules();
        for (int i=0;dcModule==null && i<modules.size();i++) {
            ModuleI module = (ModuleI) modules.get(i);
            if (module.getUri().equals(DCModuleI.URI)) {
                dcModule = (DCModuleI) module;
View Full Code Here

Examples of com.sun.syndication.feed.module.DCModuleI

        return DC_URI;
    }

    public void generate(ModuleI module, Element element) {

        DCModuleI dcModule = (DCModuleI)module;

        if (dcModule.getTitle() != null) {
            element.addContent(generateSimpleElement("title", dcModule.getTitle()));
        }
        if (dcModule.getCreator() != null) {
            element.addContent(generateSimpleElement("creator", dcModule.getCreator()));
        }
        List subjects = dcModule.getSubjects();
        for (int i = 0; i < subjects.size(); i++) {
            element.addContent(generateSubjectElement((DCSubjectI) subjects.get(i)));
        }
        if (dcModule.getDescription() != null) {
            element.addContent(generateSimpleElement("description", dcModule.getDescription()));
        }
        if (dcModule.getPublisher() != null) {
            element.addContent(generateSimpleElement("publisher", dcModule.getPublisher()));
        }
        List contributors = dcModule.getContributors();
        if (contributors != null) {
            for (int i = 0; i < contributors.size(); i++) {
                String contributor = (String)contributors.get(i);
                element.addContent(generateSimpleElement("contributor", contributor));
            }
        }
        if (dcModule.getDate() != null) {
            element.addContent(
                generateSimpleElement("date", DateParser.parseW3CDateTime(dcModule.getDate())));
        }
        if (dcModule.getType() != null) {
            element.addContent(generateSimpleElement("type", dcModule.getType()));
        }
        if (dcModule.getFormat() != null) {
            element.addContent(generateSimpleElement("format", dcModule.getFormat()));
        }
        if (dcModule.getIdentifier() != null) {
            element.addContent(generateSimpleElement("identifier", dcModule.getIdentifier()));
        }
        if (dcModule.getSource() != null) {
            element.addContent(generateSimpleElement("source", dcModule.getSource()));
        }
        if (dcModule.getLanguage() != null) {
            element.addContent(generateSimpleElement("language", dcModule.getLanguage()));
        }
        if (dcModule.getRelation() != null) {
            element.addContent(generateSimpleElement("relation", dcModule.getRelation()));
        }
        if (dcModule.getCoverage() != null) {
            element.addContent(generateSimpleElement("coverage", dcModule.getCoverage()));
        }
        if (dcModule.getRights() != null) {
            element.addContent(generateSimpleElement("rights", dcModule.getRights()));
        }
    }
View Full Code Here

Examples of com.sun.syndication.feed.module.DCModuleI

        return Namespace.getNamespace(DCModuleI.URI);
    }

    public ModuleI parse(Element dcRoot) {
        boolean foundSomething = false;
        DCModuleI dcm = new DCModule();

        Element e = dcRoot.getChild("title",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setTitle(e.getText());
        }
        e = dcRoot.getChild("creator",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setCreator(e.getText());
        }
        List eList = dcRoot.getChildren("subject",getDCNamespace());
        if (eList.size()>0) {
            foundSomething = true;
            dcm.setSubjects(parseSubjects(eList));
        }
        e = dcRoot.getChild("description",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setDescription(e.getText());
        }
        e = dcRoot.getChild("publisher",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setPublisher(e.getText());
        }
        eList = dcRoot.getChildren("contributor",getDCNamespace());
        if (eList.size()>0) {
            foundSomething = true;
            dcm.setContributors(parseContributors(eList));
        }
        e = dcRoot.getChild("date",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setDate(DateParser.parseW3CDateTime(e.getText()));
        }
        e = dcRoot.getChild("type",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setType(e.getText());
        }
        e = dcRoot.getChild("format",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setFormat(e.getText());
        }
        e = dcRoot.getChild("identifier",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setIdentifier(e.getText());
        }
        e = dcRoot.getChild("source",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setSource(e.getText());
        }
        e = dcRoot.getChild("language",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setLanguage(e.getText());
        }
        e = dcRoot.getChild("relation",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setRelation(e.getText());
        }
        e = dcRoot.getChild("coverage",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setCoverage(e.getText());
        }
        e = dcRoot.getChild("rights",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            dcm.setRights(e.getText());
        }

        return (foundSomething) ? dcm : null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.