Package org.apache.axiom.om.impl.dom

Examples of org.apache.axiom.om.impl.dom.ElementImpl


    public OMDocument createOMDocument() {
        return new DocumentImpl(this);
    }

    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new ElementImpl(null, localName, ns, null, this, true);
    }
View Full Code Here


    public OMElement createOMElement(String localName, OMNamespace ns,
                                     OMContainer parent) throws OMDOMException {
        if (parent == null) {
            return createOMElement(localName, ns);
        } else {
            return new ElementImpl((ParentNode) parent, localName, ns, null, this, true);
        }
    }
View Full Code Here

    }

    /** Creates an OMElement with the builder. */
    public OMElement createOMElement(String localName, OMContainer parent,
                                     OMXMLParserWrapper builder) {
        return new ElementImpl((ParentNode) parent, localName, null, builder, this, false);
    }
View Full Code Here

    public void setDocument(DocumentImpl document) {
        this.document = document;
    }

    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new ElementImpl((DocumentImpl) this.createOMDocument(),
                               localName, (NamespaceImpl) ns, this);
    }
View Full Code Here

    }

    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");
View Full Code Here

    /** 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 " +
View Full Code Here

    public OMText createOMText(OMContainer parent, OMText source) {
        return new TextImpl(parent, (TextImpl) source, this);
    }

    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;
    }
View Full Code Here

    getDetail();
    if (getDetail() == null) {
      setDetail(getNewSOAPFaultDetail(this));

    }
    OMElement faultDetailEnty = new ElementImpl((ParentNode) this,
        SOAPConstants.SOAP_FAULT_DETAIL_EXCEPTION_ENTRY,
        null, this.factory);
    faultDetailEnty.setText(sw.getBuffer().toString());
  }
View Full Code Here

    public void setDocument(DocumentImpl document) {
        this.document = document;
    }

    public OMElement createOMElement(String localName, OMNamespace ns) {
        return new ElementImpl((DocumentImpl) this.createOMDocument(),
                               localName, (NamespaceImpl) ns, this);
    }
View Full Code Here

    }

    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");
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.dom.ElementImpl

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.