Package org.jibx.util

Examples of org.jibx.util.StringIntSizedMap


        IBindingFactory ifact = BindingDirectory.getFactory(Definitions.class);
        m_marshalContext = (MarshallingContext)ifact.createMarshallingContext();
       
        // initialize namespace URI to index map
        String[] nss = ifact.getNamespaces();
        s_namespaceMap = new StringIntSizedMap(nss.length);
        for (int i = 0; i < nss.length; i++) {
            s_namespaceMap.add(nss[i], i);
        }
       
        // create other statics used in code
View Full Code Here


            try {
               
                // build sets of namespace uris and prefixes
                IXMLWriter writer = ictx.getXmlWriter();
                int curcnt = writer.getNamespaceCount();
                StringIntSizedMap uriindexes = new StringIntSizedMap(curcnt);
                int defcnt = m_namespaces.size() / 2;
                StringSizedSet prefixes = new StringSizedSet(curcnt + defcnt);
                for (int i = 0; i < curcnt; i++) {
                    uriindexes.add(writer.getNamespaceUri(i), i);
                    String prefix = writer.getNamespacePrefix(i);
                    if (prefix != null && prefix.length() > 0) {
                        prefixes.add(prefix);
                    }
                }
               
                // check namespace declarations on this element against writer state
                List uris = new ArrayList();
                GrowableIntArray indexes = new GrowableIntArray();
                GrowableStringArray prefs = new GrowableStringArray();
                int base = writer.getNamespaceCount();
                for (int i = 0; i < defcnt; i++) {
                    String pref = (String)m_namespaces.get(i * 2);
                    String uri = (String)m_namespaces.get(i * 2 + 1);
                    int index = uriindexes.get(uri);
                    if (index >= 0) {
                        if (writer.getNamespacePrefix(index) == null) {
                            indexes.add(index);
                            prefs.add(makeUniquePrefix(pref, prefixes));
                        }
View Full Code Here

TOP

Related Classes of org.jibx.util.StringIntSizedMap

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.