Package com.sun.syndication.feed.module

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


        return Namespace.getNamespace(DCModule.URI);
    }

    public Module parse(Element dcRoot) {
        boolean foundSomething = false;
        DCModule dcm = new DCModuleImpl();

        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


    protected TestSyndFeedRSS10DCMulti(String feedType, String feedFileName) {
        super(feedType, feedFileName);
    }

    public void testChannelDCModule() throws Exception {
        DCModule dc = (DCModule) getCachedSyndFeed().getModule(DCModule.URI);
        _testDCModule(dc, "channel.");
    }
View Full Code Here

    }

    protected void _testItemDCModule(int i) throws Exception {
        List entries = getCachedSyndFeed().getEntries();
        SyndEntry entry = (SyndEntry) entries.get(i);
        DCModule dc = (DCModule) entry.getModule(DCModule.URI);
        _testDCModule(dc, "item[" + i + "].");
    }
View Full Code Here

        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

Related Classes of com.sun.syndication.feed.module.DCModule

Copyright © 2018 www.massapicom. 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.