Package com.sun.syndication.feed.module

Examples of com.sun.syndication.feed.module.SyModuleI$Period


        PERIODS.put(SyModuleI.YEARLY.toString(),SyModuleI.YEARLY);
    }

    public ModuleI parse(Element syndRoot) {
        boolean foundSomething = false;
        SyModuleI sm = new SyModule();

        Element e = syndRoot.getChild("updatePeriod",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            sm.setUpdatePeriod((SyModuleI.Period)PERIODS.get(e.getText()));
        }
        e = syndRoot.getChild("updateFrequency",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            sm.setUpdateFrequency(Integer.parseInt(e.getText()));
        }
        e = syndRoot.getChild("updateBase",getDCNamespace());
        if (e!=null) {
            foundSomething = true;
            sm.setUpdateBase(DateParser.parseW3CDateTime(e.getText()));
        }
        return (foundSomething) ? sm : null;
    }
View Full Code Here


        return SY_URI;
    }

    public void generate(ModuleI module, Element element) {

        SyModuleI syModule = (SyModuleI)module;

        Element updatePeriodElement = new Element("updatePeriod", SY_NS);
        updatePeriodElement.addContent(syModule.getUpdatePeriod().toString());
        element.addContent(updatePeriodElement);

        Element updateFrequencyElement = new Element("updateFrequency", SY_NS);
        updateFrequencyElement.addContent(String.valueOf(syModule.getUpdateFrequency()));
        element.addContent(updateFrequencyElement);

        Element updateBaseElement = new Element("updateBase", SY_NS);
        updateBaseElement.addContent(DateParser.parseW3CDateTime(syModule.getUpdateBase()));
        element.addContent(updateBaseElement);
    }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.module.SyModuleI$Period

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.