Examples of SequencedHashMap


Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

     * @return a map of all the source/target URLs needed to copy
     * the file along with all its relative referents.
     */
    public static Map findAllRelative(URL source, URL target)
    {
        Map result = new SequencedHashMap();
        result.put(source, target);

        LinkedList process = new LinkedList();
        process.add(source);

        while (!process.isEmpty())
        {
            URL nextSource = (URL)process.removeFirst();
            URL nextTarget = (URL)result.get(nextSource);
            Map nextResults = findRelativeInOne(nextSource, nextTarget);
            for (Iterator i = nextResults.keySet().iterator(); i.hasNext(); )
            {
                URL newSource = (URL)i.next();
                if (result.containsKey(newSource))
                    continue;
                result.put(newSource, nextResults.get(newSource));
                process.add(newSource);
            }
        }

        return result;
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        {
            XmlObject xobj = XmlObject.Factory.parse(source, loadOptions);
            XmlCursor xcur = xobj.newCursor();
            xcur.toFirstChild();

            Map result = new SequencedHashMap();

            if (xobj instanceof SchemaDocument)
                putMappingsFromSchema(result, source, target, ((SchemaDocument)xobj).getSchema());
            else if (xobj instanceof DefinitionsDocument)
                putMappingsFromWsdl(result, source, target, ((DefinitionsDocument)xobj).getDefinitions());
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

    public void testAdditionalNamespaces()
        throws Exception
    {
        String xml = "<a xmlns:a='aNS'><a:b/></a>";

        Map map = new SequencedHashMap();
        map.put("b", "bNS");
        map.put("c", "cNS");
        map.put("a", "not-aNS");

        XmlOptions options = new XmlOptions();
        options.setLoadAdditionalNamespaces(map);

        XmlObject x = XmlObject.Factory.parse(xml, options);

        // 'a' prefix namespace is not remapped
        String expect = "<a xmlns:c=\"cNS\" xmlns:b=\"bNS\" xmlns:a=\"aNS\"><a:b/></a>";
        Assert.assertEquals( expect, x.xmlText() );

        xml = "<a xmlns='aNS'><b/></a>";

        map = new SequencedHashMap();
        map.put("b", "bNS");
        map.put("c", "cNS");
        map.put("", "not-aNS");

        options = new XmlOptions();
        options.setLoadAdditionalNamespaces(map);

        x = XmlObject.Factory.parse(xml, options);
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        }

        int particleCode = translateParticleCode(parseGroup);

        // used to ensure consistency (doesn't become part of the result)
        Map elementModel = new SequencedHashMap();

        // build content model and anonymous types
        SchemaParticle contentModel = translateContentModel(sImpl, parseGroup, targetNamespace, chameleon, particleCode, anonymousTypes, elementModel, false, null);

        // detect the nonempty "all" case (empty <all> doesn't count - it needs to be eliminated to match XSD test cases)
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        // detect the "all" case
        int particleCode = translateParticleCode(parseEg);

        // used to ensure consistency (doesn't become part of the result)
        Map elementModel = new SequencedHashMap();

        // build content model and anonymous types
        SchemaParticle contentModel = translateContentModel(
            sImpl, parseEg, targetNamespace, chameleon, particleCode, anonymousTypes, elementModel, false, null);
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        list.add(part);
    }

    static Map buildAttributePropertyModelByQName(SchemaAttributeModel attrModel, SchemaType owner)
    {
        Map result = new SequencedHashMap();
        SchemaLocalAttribute[] attruses = attrModel.getAttributes();

        for (int i = 0; i < attruses.length; i++)
            result.put(attruses[i].getName(), buildUseProperty(attruses[i], owner));

        return result;
    }
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        }

        if (model == null)
        {
            // build model for children
            model = new SequencedHashMap();
            SchemaParticle[] children = part.getParticleChildren();

            for (int i = 0; i < children.length; i++)
            {
                // indentDBG();
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

     * Only used in the nonbootstrapped case.
     */
    private Map buildTypeRefsByClassname()
    {
        List allSeenTypes = new ArrayList();
        Map result = new SequencedHashMap();
        allSeenTypes.addAll(Arrays.asList(documentTypes()));
        allSeenTypes.addAll(Arrays.asList(attributeTypes()));
        allSeenTypes.addAll(Arrays.asList(globalTypes()));

        // now fully javaize everything deeply.
        for (int i = 0; i < allSeenTypes.size(); i++)
        {
            SchemaType gType = (SchemaType)allSeenTypes.get(i);
            String className = gType.getFullJavaName();
            if (className != null)
            {
                result.put(className.replace('$', '.'), gType.getRef());
            }
            allSeenTypes.addAll(Arrays.asList(gType.getAnonymousTypes()));
        }
        return result;
    }
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        return result;
    }

    private Map buildTypeRefsByClassname(Map typesByClassname)
    {
        Map result = new SequencedHashMap();
        for (Iterator i = typesByClassname.keySet().iterator(); i.hasNext(); )
        {
            String className = (String)i.next();
            result.put(className, ((SchemaType)typesByClassname.get(className)).getRef());
        }
        return result;
    }
View Full Code Here

Examples of org.apache.xmlbeans.impl.common.SequencedHashMap

        return result;
    }

    private static Map buildComponentRefMap(SchemaComponent[] components)
    {
        Map result = new SequencedHashMap();
        for (int i = 0; i < components.length; i++)
            result.put(components[i].getName(), components[i].getComponentRef());
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.