public FOMDocument() { super(new FOMFactory()); }
protected OMElement _create(OMElement src) { OMElement el = null; FOMFactory fomfactory = (FOMFactory)factory; Object obj = null; if (src instanceof Content) obj = ((Content)src).getContentType(); if (src instanceof Text) obj = ((Text)src).getTextType(); el = fomfactory.createElement(src.getQName(), (OMContainer)fomfactory.newDocument(), factory, obj); return el; }
public Object next() { return factory.getElementWrapper((Element)iterator.next()); }
public Categories newCategories() { Document<Categories> doc = newDocument(); return newCategories(doc); }
public Content newContent(Type type) { if (type == null) type = Content.Type.TEXT; return newContent(type, null); }
public Category newCategory() { return newCategory(null); }
public Person newContributor() { return newContributor(null); }
public Person newAuthor() { return newAuthor(null); }
public Categories addCategories() { complete(); return ((FOMFactory)factory).newCategories(this); }
public <T extends Element> T newExtensionElement(QName qname, Base parent) { String ns = qname.getNamespaceURI(); Element el = (Element)createElement(qname, (OMContainer)parent, this, null); return (T)((ATOM_NS.equals(ns) || APP_NS.equals(ns)) ? el : factoriesMap.getElementWrapper(el)); }
public Collection newCollection() { return newCollection(null); }
protected OMElement createElement(QName qname, OMContainer parent, OMFactory factory, Object objecttype) { OMElement element = null; OMNamespace namespace = this.createOMNamespace(qname.getNamespaceURI(), qname.getPrefix()); if (FEED.equals(qname)) { element = new FOMFeed(qname.getLocalPart(), namespace, parent, factory);
public Content newContent() { return newContent(Content.Type.TEXT); }
public Category addCategory(String term) { complete(); FOMFactory factory = (FOMFactory)this.factory; Category category = factory.newCategory(this); category.setTerm(term); return category; }
public Person addContributor(String name) { complete(); FOMFactory fomfactory = (FOMFactory)this.factory; Person person = fomfactory.newContributor(this); person.setName(name); return person; }
public Person addAuthor(String name) { complete(); FOMFactory fomfactory = (FOMFactory)this.factory; Person person = fomfactory.newAuthor(this); person.setName(name); return person; }
public Categories addCategories(String href) { complete(); Categories cats = ((FOMFactory)factory).newCategories(); cats.setHref(href); addCategories(cats); return cats; }
@Override protected OMElement constructNode(OMContainer parent, String name) { OMElement element = null; if (!indoc) { parent = document; indoc = true; } QName qname = parser.getName(); element = fomfactory.createElement(qname, parent, this); if (element == null) { element = new FOMElement(qname.getLocalPart(), parent, fomfactory, this); } return element; }
public Collection addCollection(String title, String href) { complete(); FOMFactory fomfactory = (FOMFactory)factory; Collection collection = fomfactory.newCollection(this); collection.setTitle(title); collection.setHref(href); return collection; }
public Content newContent(MimeType mediaType) { return newContent(mediaType, null); }