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

Examples of org.apache.axiom.om.impl.dom.factory.OMDOMFactory


                , uri, prefix);
        return new SOAPElementImpl((ElementImpl)omElement);
    }

    public SOAPElement createElement(Element element) throws SOAPException {
        OMDOMFactory omdomFactory = null;
        if (soapVersion.equals(SOAPConstants.SOAP_1_2_PROTOCOL)) {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP12Factory();
        } else {
            omdomFactory = (OMDOMFactory)DOOMAbstractFactory.getSOAP11Factory();
        }
        OMNamespace ns = omdomFactory.createOMNamespace(element.getNamespaceURI()
                , element.getPrefix());
        OMElement omElement = omdomFactory.createOMElement(element.getLocalName(), ns);
        return new SOAPElementImpl((ElementImpl)omElement);
    }
View Full Code Here


     * Returns a new document impl.
     *
     * @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

    }

    public Document parse(InputSource inputSource) throws SAXException,
            IOException {
        try {
            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();
View Full Code Here

    }

    /** @see javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream) */
    public Document parse(InputStream is) throws SAXException, IOException {
        try {
            OMDOMFactory factory = new OMDOMFactory();
            XMLStreamReader reader = StAXUtils
                    .createXMLStreamReader(is);
            StAXOMBuilder builder = new StAXOMBuilder(factory, reader);
            return (DocumentImpl) builder.getDocument();
        } catch (XMLStreamException e) {
View Full Code Here

    }

    /** @see javax.xml.parsers.DocumentBuilder#parse(java.io.File) */
    public Document parse(File file) throws SAXException, IOException {
        try {
            OMDOMFactory factory = new OMDOMFactory();
            XMLStreamReader reader = StAXUtils
                    .createXMLStreamReader(new FileInputStream(file));
            StAXOMBuilder builder = new StAXOMBuilder(factory, reader);
            return (DocumentImpl) builder.getDocument();
        } catch (XMLStreamException e) {
View Full Code Here

    public Document createDocument(String namespaceURI, String qualifiedName,
                                   DocumentType doctype) throws DOMException {

        // TODO Handle docType stuff
        OMDOMFactory fac = new OMDOMFactory();
        DocumentImpl doc = new DocumentImpl(fac);
        fac.setDocument(doc);

        new ElementImpl(doc, DOMUtil.getLocalName(qualifiedName),
                        new NamespaceImpl(namespaceURI, DOMUtil
                                .getPrefix(qualifiedName)), fac);
View Full Code Here

        if (validateTargetElem != null) {
       
            OMElement strElem = validateTargetElem.getFirstChildWithName(new QName(WSConstants.WSSE_NS,
                                                   "SecurityTokenReference"));
           
            Element elem = (Element)(new StAXOMBuilder(new OMDOMFactory(),
                    strElem.getXMLStreamReader()).getDocumentElement());
           
            try {
                SecurityTokenReference str = new SecurityTokenReference((Element)elem);
                if (str.containsReference()) {
View Full Code Here

        if (renewTargetElem != null) {
       
            OMElement strElem = renewTargetElem.getFirstChildWithName(new QName(WSConstants.WSSE_NS,
                                                   "SecurityTokenReference"));
           
            Element elem = (Element)(new StAXOMBuilder(new OMDOMFactory(),
                    strElem.getXMLStreamReader()).getDocumentElement());
           
            try {
                SecurityTokenReference str = new SecurityTokenReference((Element)elem);
                if (str.containsReference()) {
View Full Code Here

    }

    public void testCreateElement() {
        String tagName = "LocalName";
        String namespace = "http://ws.apache.org/axis2/ns";
        OMDOMFactory fac = new OMDOMFactory();
        DocumentImpl doc = new DocumentImpl(fac);
        Element elem = doc.createElement(tagName);

        assertEquals("Local name misnatch", tagName, elem.getNodeName());
View Full Code Here

        String attrName = "attrIdentifier";
        String attrValue = "attrValue";
        String attrNs = "http://ws.apache.org/axis2/ns";
        String attrNsPrefix = "axis2";

        OMDOMFactory fac = new OMDOMFactory();
        DocumentImpl doc = new DocumentImpl(fac);
        Attr attr = doc.createAttribute(attrName);

        assertEquals("Attr name mismatch", attrName, attr.getName());
        assertNull("Namespace value should be null", attr.getNamespaceURI());
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.dom.factory.OMDOMFactory

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.