public Feed newFeed() { Document<Feed> doc = newDocument(); return newFeed(doc); }
public <T extends Element> Document<T> newDocument(T root, OMXMLParserWrapper parserWrapper) { FOMDocument<T> doc = (FOMDocument<T>)newDocument(parserWrapper); doc.setRoot(root); return doc; }
public Entry newEntry() { Document<Entry> doc = newDocument(); return newEntry(doc); }
public Service newService() { Document<Service> doc = newDocument(); return newService(doc); }
public Categories newCategories() { Document<Categories> doc = newDocument(); return newCategories(doc); }
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 FOMBuilder(FOMFactory factory, XMLStreamReader parser, ParserOptions parserOptions) { super(factory, new FOMStAXFilter(parser, parserOptions)); this.document = (OMDocument)factory.newDocument(); this.parserOptions = parserOptions; this.fomfactory = factory; String enc = parser.getCharacterEncodingScheme(); document.setCharsetEncoding(enc != null ? enc : "utf-8"); document.setXMLVersion(parser.getVersion() != null ? parser.getVersion() : "1.0"); }
public Object clone() { Document<T> doc = ((FOMFactory)factory).newDocument(); OMDocument omdoc = (OMDocument)doc; for (Iterator i = getChildren(); i.hasNext();) { OMNode node = (OMNode)i.next(); switch (node.getType()) { case OMNode.COMMENT_NODE: OMComment comment = (OMComment)node; factory.createOMComment(omdoc, comment.getValue()); break; // TODO: Decide what to do with this code; it will no longer work in Axiom 1.2.14 (because of AXIOM-437). // On the other hand, since we filter out DTDs, this code is never triggered. // case OMNode.DTD_NODE: // OMDocType doctype = (OMDocType)node; // factory.createOMDocType(omdoc, doctype.getValue()); // break; case OMNode.ELEMENT_NODE: Element el = (Element)node; omdoc.addChild((OMNode)el.clone()); break; case OMNode.PI_NODE: OMProcessingInstruction pi = (OMProcessingInstruction)node; factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue()); break; } } return doc; }