public OMText createOMText(OMContainer parent, char[] charArary, int type) { ElementImpl parentElem = (ElementImpl) parent; TextImpl txt = new TextImpl((DocumentImpl) parentElem .getOwnerDocument(), charArary, this); parentElem.addChild(txt); return txt; }
/** * Creates a new OMDOM Text node with the given value and appends it to the given parent * element. * * @see org.apache.axiom.om.OMFactory#createOMText( org.apache.axiom.om.OMElement,String) */ public OMText createOMText(OMContainer parent, String text) { ElementImpl parentElem = (ElementImpl) parent; TextImpl txt = new TextImpl((DocumentImpl) parentElem .getOwnerDocument(), text, this); parentElem.addChild(txt); return txt; }
/** * Creates an OMDOM Text node, adds it to the give parent element and returns it. * * @see org.apache.axiom.om.OMFactory#createOMText(OMContainer, String, * String, boolean) */ public OMText createOMText(OMContainer parent, String s, String mimeType, boolean optimize) { TextImpl text = new TextImpl((DocumentImpl) ((ElementImpl) parent) .getOwnerDocument(), s, mimeType, optimize, this); parent.addChild(text); return text; }
if (!this.getOwnerDocument().equals(attr.getOwnerDocument())) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN,
if (!this.getOwnerDocument().equals(attr.getOwnerDocument())) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "WRONG_DOCUMENT_ERR",
/** Creates an OMElement with the builder. */ public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper builder) { switch (((ParentNode) parent).getNodeType()) { case Node.ELEMENT_NODE: // We are adding a new child to an elem ElementImpl parentElem = (ElementImpl) parent; ElementImpl elem = new ElementImpl((DocumentImpl) parentElem .getOwnerDocument(), localName, (NamespaceImpl) ns, builder, this); parentElem.appendChild(elem); return elem; case Node.DOCUMENT_NODE: DocumentImpl docImpl = (DocumentImpl) parent; ElementImpl elem2 = new ElementImpl(docImpl, localName, (NamespaceImpl) ns, builder, this); docImpl.appendChild(elem2); return elem2; case Node.DOCUMENT_FRAGMENT_NODE: DocumentFragmentImpl docFragImpl = (DocumentFragmentImpl) parent; return new ElementImpl((DocumentImpl) docFragImpl .getOwnerDocument(), localName, (NamespaceImpl) ns, builder, this); default: throw new OMDOMException( "The parent container can only be an ELEMENT, DOCUMENT " + "or a DOCUMENT FRAGMENT"); } }
public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) throws OMDOMException { if (parent == null) { return new ElementImpl((DocumentImpl) this.createOMDocument(), localName, (NamespaceImpl) ns, this); } switch (((ParentNode) parent).getNodeType()) { case Node.ELEMENT_NODE: // We are adding a new child to an elem ElementImpl parentElem = (ElementImpl) parent; ElementImpl elem = new ElementImpl((DocumentImpl) parentElem .getOwnerDocument(), localName, (NamespaceImpl) ns, this); parentElem.appendChild(elem); return elem; case Node.DOCUMENT_NODE: DocumentImpl docImpl = (DocumentImpl) parent; return new ElementImpl(docImpl, localName, (NamespaceImpl) ns, this); case Node.DOCUMENT_FRAGMENT_NODE: DocumentFragmentImpl docFragImpl = (DocumentFragmentImpl) parent; return new ElementImpl((DocumentImpl) docFragImpl .getOwnerDocument(), localName, (NamespaceImpl) ns, this); default: throw new OMDOMException( "The parent container can only be an ELEMENT, DOCUMENT " + "or a DOCUMENT FRAGMENT"); } }
.getPrefix(qualifiedName)); AttrImpl attr = new AttrImpl((DocumentImpl) this .getOwnerDocument(), DOMUtil .getLocalName(qualifiedName), ns, value, this.factory); this.attributes.setNamedItem(attr); } else { AttrImpl attr = new AttrImpl((DocumentImpl) this .getOwnerDocument(), qualifiedName, value, this.factory); this.attributes.setNamedItem(attr); return attr;