1 18 package org.apache.roller.webservices.atomprotocol; 19 20 import org.jdom.Element; 21 import org.jdom.Namespace; 22 23 import com.sun.syndication.feed.module.Module; 24 import com.sun.syndication.io.ModuleParser; 25 26 public class PubControlModuleParser implements ModuleParser { 27 28 public String getNamespaceUri() { 29 return PubControlModule.URI; 30 } 31 32 public Namespace getContentNamespace() { 33 return Namespace.getNamespace(PubControlModule.URI); 34 } 35 public Module parse(Element elem) { 36 boolean foundSomething = false; 37 PubControlModule m = new PubControlModuleImpl(); 38 Element e = elem.getChild("control", getContentNamespace()); 39 if (e != null) { 40 Element draftElem = e.getChild("draft", getContentNamespace()); 41 if (draftElem != null) { 42 if ("yes".equals(draftElem.getText())) m.setDraft(true); 43 if ("no".equals(draftElem.getText())) m.setDraft(false); 44 } 45 } 46 return m; 47 } 48 } 49 50 | Popular Tags |