Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.QNameSet


    public TypeStoreUser add_element_user ( QName name )
    {
        if (!isContainer())
            throw new IllegalStateException();

        QNameSet endSet = null;
        boolean  gotEndSet = false;

        Xobj candidate = null;

        for ( Xobj x = _lastChild ; x != null ; x = x._prevSibling )
        {
            if (x.isContainer())
            {
                if (x._name.equals( name ))
                    break;

                if (!gotEndSet)
                {
                    endSet = _user.get_element_ending_delimiters( name );
                    gotEndSet = true;
                }

                if (endSet == null || endSet.contains( x._name ))
                    candidate = x;
            }
        }

        return
View Full Code Here


                if (particleType != SchemaParticle.ELEMENT)
                    throw new SchemaTypeLoaderException("Wrong particle type ", _name, _handle, SchemaTypeLoaderException.BAD_PARTICLE_TYPE);
                short particleFlags = readShort();
                BigInteger minOccurs = readBigInteger();
                BigInteger maxOccurs = readBigInteger();
                QNameSet transitionRules = readQNameSet();
                QName name = readQName();
                SchemaContainer container = getContainer(name.getNamespaceURI());
                assert container != null;
                SchemaGlobalElementImpl impl = new SchemaGlobalElementImpl(container);
                impl.setParticleType(particleType);
View Full Code Here

            _wildcardElement = currentParticle;

            if (currentParticle.getParticleType() == SchemaParticle.WILDCARD)
            {
                //_wildcardElement = currentParticle;
                QNameSet elemWildcardSet = currentParticle.getWildcardSet();

                if (!elemWildcardSet.contains( name ))
                {
                    // Additional processing may be needed to generate more
                    // descriptive messages
                    // KHK: cvc-complex-type.2.4? cvc-particle.1.3? cvc-wildcard-namespace ?
                    emitFieldError(event, XmlErrorCodes.PARTICLE_VALID$NOT_WILDCARD_VALID,
View Full Code Here

                attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type);

            return;
        }

        QNameSet attrWildcardSet = state._attrModel.getWildcardSet();

        if (!attrWildcardSet.contains( attrName ))
        {
            // todo (dutta) need additional logic to determine the expectedSchemaType
            emitFieldError( event, XmlErrorCodes.ELEM_COMPLEX_TYPE_LOCALLY_VALID$NOT_WILDCARD_VALID,
                new Object[] { QNameHelper.pretty( attrName ) },
                attrName, null, null, XmlValidationError.INCORRECT_ATTRIBUTE, state._type);
View Full Code Here

                    addBuilder((T) event.getMember());
                }

                public void memberRemoved(ReferenceCollectionEvent event) {
                    T builder = (T) event.getMember();
                    QNameSet builderSpecQNames = ((AbstractNamespaceBuilder) builder).getSpecQNameSet();
                    specQNames = specQNames.intersect(builderSpecQNames.inverse());
                    QNameSet builderPlanQNames = ((AbstractNamespaceBuilder) builder).getPlanQNameSet();
                    planQNames = planQNames.intersect(builderPlanQNames.inverse());
                    XmlBeansUtil.unregisterSubstitutionGroupElements(basePlanElementName, builderPlanQNames);
                }
            });
        }
        for (T builder : this.builders) {
View Full Code Here

        }
    }


    protected void addBuilder(T builder) {
        QNameSet builderSpecQNames = ((AbstractNamespaceBuilder) builder).getSpecQNameSet();
        QNameSet builderPlanQNames = ((AbstractNamespaceBuilder) builder).getPlanQNameSet();
        if (builderSpecQNames == null) {
            throw new IllegalStateException("Builder " + builder + " is missing spec qnames");
        }
        if (builderPlanQNames == null) {
            throw new IllegalStateException("Builder " + builder + " is missing plan qnames");
View Full Code Here

        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
        return options;
    }

    public static void registerSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
        QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
        if (oldSubstitutions != null) {
            substitutions = oldSubstitutions.union(substitutions);
        }
        substitutionGroups.put(substitutionGroup, substitutions);
    }
View Full Code Here

        }
        substitutionGroups.put(substitutionGroup, substitutions);
    }

    public static void unregisterSubstitutionGroupElements(QName substitutionGroup, QNameSet substitutions) {
        QNameSet oldSubstitutions = substitutionGroups.get(substitutionGroup);
        if (oldSubstitutions != null && substitutions != null) {
            QNameSet difference = oldSubstitutions.intersect(substitutions.inverse());
            substitutionGroups.put(substitutionGroup, difference);
        }
    }
View Full Code Here

    public static QNameSet getQNameSetForSubstitutionGroup(QName substitutionGroup) {
        return substitutionGroups.get(substitutionGroup);
    }

    public static XmlObject[] selectSubstitutionGroupElements(QName substitutionGroup, XmlObject container) {
        QNameSet substitutionGroupMembers = getQNameSetForSubstitutionGroup(substitutionGroup);
        if (substitutionGroupMembers == null) {
            return NO_ELEMENTS;
        }
        return container.selectChildren(substitutionGroupMembers);
    }
View Full Code Here

                        XmlValidationError validationError = (XmlValidationError) o;
                        List<QName> expected = validationError.getExpectedQNames();
                        QName actual = validationError.getOffendingQName();
                        if (expected != null) {
                            for (QName expectedQName : expected) {
                                QNameSet substitutions = getQNameSetForSubstitutionGroup(expectedQName);
                                if (substitutions != null && substitutions.contains(actual)) {
                                    iterator.remove();
                                    break;
                                }
                            }
                        }
View Full Code Here

TOP

Related Classes of org.apache.xmlbeans.QNameSet

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.