Package org.apache.axiom.om.impl

Examples of org.apache.axiom.om.impl.OMNamespaceImpl


    public void testName2Unqualified() throws Exception {

        OMFactory f = new OMLinkedListImplFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = new OMNamespaceImpl("http://sampleroot", "rootPrefix");
        OMNamespace ns = new OMNamespaceImpl("", "");
        OMElement element =
                new OMSourcedElementImpl("library", ns, f, new TestDataSource(testDocument3));
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here


    public void testName3Unqualified() throws Exception {

        OMFactory f = new OMLinkedListImplFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = new OMNamespaceImpl("http://sampleroot", "rootPrefix");
        OMNamespace ns = new OMNamespaceImpl("http://DUMMYNS", "DUMMYPREFIX");
        OMElement element =
                new OMSourcedElementImpl("DUMMYNAME", ns, f, new TestDataSource(testDocument3));
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

    public void testName4Unqualified() throws Exception {

        OMFactory f = new OMLinkedListImplFactory();

        // Create OMSE with a DUMMYPREFIX prefix even though the underlying element uses the default prefix
        OMNamespace rootNS = new OMNamespaceImpl("http://sampleroot", "rootPrefix");
        OMNamespace ns = new OMNamespaceImpl("http://DUMMYNS", "");
        OMElement element =
                new OMSourcedElementImpl("DUMMYNAME", ns, f, new TestDataSource(testDocument3));
        OMElement root = f.createOMElement("root", rootNS);
        root.addChild(element);
View Full Code Here

        dataSource = source;
        isExpanded = (dataSource == null);
        if (!isExpanded) {
            if (!isLossyPrefix(dataSource)) {
                // Believe the prefix and create a normal OMNamespace
                definedNamespace = new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
            } else {
                // Create a deferred namespace that forces an expand to get the prefix
                definedNamespace = new DeferredNamespace(qName.getNamespaceURI());
            }
        } else {
            definedNamespace = new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
        }
    }
View Full Code Here

                ((OMDataSourceExt) source).getProperty(OMDataSourceExt.LOSSY_PREFIX);
                       
        }
        if (lossyPrefix != Boolean.TRUE) {
            // Believe the prefix and create a normal OMNamespace
            definedNamespace = new OMNamespaceImpl(uri, prefix);
        } else {
            // Create a deferred namespace that forces an expand to get the prefix
            definedNamespace = new DeferredNamespace(uri);
        }
    }
View Full Code Here

                 ns instanceof DeferredNamespace) {
                if (log.isDebugEnabled()) {
                    log.debug(
                            "forceExpand: changing prefix from " + prefix + " to " + readerPrefix);
                }
                setNamespace(new OMNamespaceImpl(readerURI, readerPrefix));
            }

        }
    }
View Full Code Here

        mtomOutputFormat.setDoOptimize(true);
        OMOutputFormat baseOutputFormat = new OMOutputFormat();
        baseOutputFormat.setDoOptimize(false);

        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMNamespaceImpl soap = new OMNamespaceImpl(
                "http://schemas.xmlsoap.org/soap/envelope/", "soap");
        OMElement envelope = new OMElementImpl("Envelope", soap, fac);
        OMElement body = new OMElementImpl("Body", soap, fac);

        OMNamespaceImpl dataName = new OMNamespaceImpl(
                "http://www.example.org/stuff", "m");
        OMElement data = new OMElementImpl("data", dataName, fac);

        DataSource dataSource = getTestResourceDataSource(imageInFileName);
        expectedDH = new DataHandler(dataSource);
View Full Code Here

     * @return Returns namespace.
     */
    public OMNamespace declareNamespace(String uri, String prefix) {
        if ("".equals(prefix))
            prefix = OMSerializerUtil.getNextNSPrefix();
        OMNamespaceImpl ns = new OMNamespaceImpl(uri, prefix);
        return declareNamespace(ns);
    }
View Full Code Here

     *
     * @param uri
     */
    public OMNamespace declareDefaultNamespace(String uri) {

        OMNamespaceImpl namespace = new OMNamespaceImpl(uri == null ? "" : uri, "");

        if (namespaces == null) {
            this.namespaces = new HashMap(5);
        }
        namespaces.put("", namespace);
View Full Code Here

            this.namespaces = new HashMap(5);
        }
        String prefix = namespace.getPrefix();
        if (prefix == null) {
            prefix = OMSerializerUtil.getNextNSPrefix();
            namespace = new OMNamespaceImpl(namespace.getNamespaceURI(), prefix);
        }
        namespaces.put(prefix, namespace);
        return namespace;
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.impl.OMNamespaceImpl

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.