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

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


     *
     * @see javax.xml.parsers.DocumentBuilder#newDocument()
     */
    public Document newDocument() {
        OMDOMFactory factory = new OMDOMFactory();
        DocumentImpl documentImpl = new DocumentImpl(factory);
        documentImpl.setComplete(true);
        return documentImpl;
    }
View Full Code Here


            OMDOMFactory factory = new OMDOMFactory();
            // Not really sure whether this will work :-?
            XMLStreamReader reader = StAXUtils
                    .createXMLStreamReader(inputSource.getCharacterStream());
            StAXOMBuilder builder = new StAXOMBuilder(factory, reader);
            DocumentImpl doc = (DocumentImpl) builder.getDocument();
            ((ElementImpl) doc.getDocumentElement()).build();
            return (DocumentImpl) builder.getDocument();
        } catch (XMLStreamException e) {
            throw new SAXException(e);
        }
    }
View Full Code Here

     * Returns a new document impl.
     *
     * @see javax.xml.parsers.DocumentBuilder#newDocument()
     */
    public Document newDocument() {
        DocumentImpl documentImpl = new DocumentImpl(factory);
        documentImpl.setComplete(true);
        return documentImpl;
    }
View Full Code Here

    }

    public Document parse(InputSource inputSource) throws SAXException, IOException {
        OMXMLParserWrapper builder = factory.getMetaFactory().createOMBuilder(factory,
                StAXParserConfiguration.DEFAULT, inputSource);
        DocumentImpl doc = (DocumentImpl) builder.getDocument();
        doc.close(true);
        return doc;
    }
View Full Code Here

    public OMMetaFactory getMetaFactory() {
        return metaFactory;
    }

    public OMDocument createOMDocument() {
        return new DocumentImpl(this);
    }
View Full Code Here

        }
        return comment;
    }

    public OMDocument createOMDocument(OMXMLParserWrapper builder) {
        return new DocumentImpl(builder, this);
    }
View Full Code Here

        return metaFactory;
    }

    public OMDocument createOMDocument() {
        if (this.document == null)
            this.document = new DocumentImpl(this);

        return this.document;
    }
View Full Code Here

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

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

    public OMText createOMText(OMContainer parent, String text, int type) {
        if (parent instanceof DocumentImpl) {
            throw new OMHierarchyException(
                    "DOM doesn't support text nodes as children of a document");
        }
        DocumentImpl ownerDocument = (DocumentImpl)((ElementImpl)parent).getOwnerDocument();
        TextNodeImpl txt;
        if (type == OMNode.CDATA_SECTION_NODE) {
            txt = new CDATASectionImpl(ownerDocument, text, this);
        } else {
            txt = new TextImpl(ownerDocument, text, type, this);
View Full Code Here

TOP

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

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.