Package org.apache.xmlbeans.impl.common

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


        try { file2 = new ZipFile(args[1]); }
        catch (IOException e) { System.out.println("Could not open zip file " + args[0] + ": " + e); System.exit(1); return; }

        System.out.println("Comparing " + args[0] + " with " + args[1] + ":");

        Set set1 = new SequencedHashSet();
        for (Enumeration e = file1.entries(); e.hasMoreElements(); )
            set1.add(((ZipEntry)e.nextElement()).getName());

        Set set2 = new SequencedHashSet();
        for (Enumeration e = file2.entries(); e.hasMoreElements(); )
            set2.add(((ZipEntry)e.nextElement()).getName());

        int errcount = 0;
        int filecount = 0;
        for (Iterator i = set1.iterator(); i.hasNext(); )
        {
            String name = (String)i.next();
            if (!set2.contains(name))
            {
                System.out.println(name + " not found in " + args[1]);
                errcount += 1;
                continue;
            }
            try
            {
                set2.remove(name);
                if (!streamsEqual(file1.getInputStream(file1.getEntry(name)), file2.getInputStream(file2.getEntry(name))))
                {
                    System.out.println(name + " does not match");
                    errcount += 1;
                    continue;
                }
            }
            catch (Exception e)
            {
                System.out.println(name + ": IO Error " + e);
                e.printStackTrace();
                errcount += 1;
                continue;
            }
            filecount += 1;
        }
        for (Iterator i = set2.iterator(); i.hasNext(); )
        {
            String name = (String)i.next();
            System.out.println(name + " not found in " + args[0]);
            errcount += 1;
        }
View Full Code Here



        // Add entries for each element property for substitution group members
        if (_propertyModelByElementName != null)
        {
            _validSubstitutions = new SequencedHashSet();
            Collection eltProps = _propertyModelByElementName.values();
            for (Iterator it = eltProps.iterator() ; it.hasNext() ; )
            {
                SchemaProperty prop = (SchemaProperty)it.next();
                QName[] names = prop.acceptedNames();
View Full Code Here

    private void setUnionCommonBaseType(SchemaType type)
        { _unionCommonBaseType = type; }

    private void computeFlatUnionModel()
    {
        Set constituentMemberTypes = new SequencedHashSet();
        Set allSubTypes = new SequencedHashSet();
        SchemaType commonBaseType = null;

        allSubTypes.add(this);

        for (int i = 0; i < _unionMemberTyperefs.length; i++)
        {
            SchemaTypeImpl mImpl = (SchemaTypeImpl)_unionMemberTyperefs[i].get();

            switch (mImpl.getSimpleVariety())
            {
                case SchemaType.LIST:
                    constituentMemberTypes.add(mImpl);
                    allSubTypes.add(mImpl);
                    commonBaseType = mImpl.getCommonBaseType(commonBaseType);
                    break;
                case SchemaType.UNION:
                    constituentMemberTypes.addAll(Arrays.asList(mImpl.getUnionConstituentTypes()));
                    allSubTypes.addAll(Arrays.asList(mImpl.getUnionSubTypes()));
                    SchemaType otherCommonBaseType = mImpl.getUnionCommonBaseType();
                    if (otherCommonBaseType != null)
                        commonBaseType = otherCommonBaseType.getCommonBaseType(commonBaseType);
                    break;
                case SchemaType.ATOMIC:
                    constituentMemberTypes.add(mImpl);
                    allSubTypes.add(mImpl);
                    commonBaseType = mImpl.getCommonBaseType(commonBaseType);
                    break;
                default:
                    if (XmlBeans.ASSERTS)
                        XmlBeans.assertTrue(false);
            }
        }

        setUnionConstituentTypes((SchemaType[])
                constituentMemberTypes.toArray(StscState.EMPTY_ST_ARRAY));
        setUnionSubTypes((SchemaType[])
                allSubTypes.toArray(StscState.EMPTY_ST_ARRAY));
        setUnionCommonBaseType(commonBaseType);
    }
View Full Code Here

                prop.setDefaultValue(readXmlValueObject());

            if (!prop.isAttribute() && atLeast(2, 17, 0))
            {
                short size = readShort();
                SequencedHashSet qnames = new SequencedHashSet();
                for (int i = 0 ; i < size ; i++)
                    qnames.add(readQName());
                prop.setAcceptedNames(qnames);
            }
            prop.setImmutable();
            return prop;
        }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.impl.common.SequencedHashSet

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.