Package org.apache.xerces.xs

Examples of org.apache.xerces.xs.XSTypeDefinition


            setCharacterData (false);
           
            if (augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI)augs.getItem (Constants.ELEMENT_PSVI);
                if (elementPSVI != null && fNamespaceAware) {
                    XSTypeDefinition type = elementPSVI.getMemberTypeDefinition ();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition ();
                    }
                    ((ElementNSImpl)el).setType (type);
                }
View Full Code Here


            setCharacterData (false);
           
            if (augs != null) {
                ElementPSVI elementPSVI = (ElementPSVI)augs.getItem (Constants.ELEMENT_PSVI);
                if (elementPSVI != null && fNamespaceAware) {
                    XSTypeDefinition type = elementPSVI.getMemberTypeDefinition ();
                    if (type == null) {
                        type = elementPSVI.getTypeDefinition ();
                    }
                    ((ElementNSImpl)el).setType (type);
                }
View Full Code Here

    /**
     * @see org.apache.ode.utils.xsd.SchemaModel#isCompatible(javax.xml.namespace.QName,
     *      javax.xml.namespace.QName)
     */
    public boolean isCompatible(QName type1, QName type2) {
        XSTypeDefinition typeDef1;
        XSTypeDefinition typeDef2;

        if (knowsElementType(type1)) {
            typeDef1 = _model.getElementDeclaration(type1.getLocalPart(),
                    type1.getNamespaceURI())
                    .getTypeDefinition();
        } else if (knowsSchemaType(type1)) {
            typeDef1 = _model.getTypeDefinition(type1.getLocalPart(),
                    type1.getNamespaceURI());
        } else {
            throw new IllegalArgumentException("unknown schema type: " + type1);
        }

        if (knowsElementType(type2)) {
            typeDef2 = _model.getElementDeclaration(type2.getLocalPart(),
                    type2.getNamespaceURI())
                    .getTypeDefinition();
        } else if (knowsSchemaType(type2)) {
            typeDef2 = _model.getTypeDefinition(type2.getLocalPart(),
                    type2.getNamespaceURI());
        } else {
            throw new IllegalArgumentException("unknown schema type: " + type2);
        }

        return typeDef1.derivedFromType(typeDef2, (short)0)
                || typeDef2.derivedFromType(typeDef1, (short)0);
    }
View Full Code Here

     */
    public boolean isSimpleType(QName type) {
        if (type == null)
            throw new NullPointerException("Null type argument!");

        XSTypeDefinition typeDef = _model.getTypeDefinition(type.getLocalPart(),
                type.getNamespaceURI());

        return (typeDef != null)
                && (typeDef.getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE);
    }
View Full Code Here

        (AttributePSVI) attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);

      if (attrPSVI != null) {
                //REVISIT: instead we should be using augmentations:
                // to set/retrieve Id attributes
                XSTypeDefinition decl = attrPSVI.getMemberTypeDefinition();
                boolean id = false;
                if (decl != null){
                    id = ((XSSimpleType)decl).isIDType();
                } else{
                    decl = attrPSVI.getTypeDefinition();
View Full Code Here

        (AttributePSVI) attributes.getAugmentations(i).getItem(Constants.ATTRIBUTE_PSVI);

      if (attrPSVI != null) {
                //REVISIT: instead we should be using augmentations:
                // to set/retrieve Id attributes
                XSTypeDefinition decl = attrPSVI.getMemberTypeDefinition();
                boolean id = false;
                if (decl != null){
                    id = ((XSSimpleType)decl).isIDType();
                } else{
                    decl = attrPSVI.getTypeDefinition();
View Full Code Here

        // ancestor is anyType, return true
        // anyType is the only type whose base type is itself
        if (ancestor.getBaseType() == ancestor)
            return true;
        // recursively get base, and compare it with ancestor
        XSTypeDefinition type = this;
        while (type != ancestor &&                      // compare with ancestor
               type != fAnySimpleType) {  // reached anySimpleType
            type = type.getBaseType();
        }

        return type == ancestor;
    }
View Full Code Here

            ANY_TYPE.equals(ancestorName)) {
            return true;
        }

        // recursively get base, and compare it with ancestor
        XSTypeDefinition type = this;
        while (!(ancestorName.equals(type.getName()) &&
                 ((ancestorNS == null && type.getNamespace() == null) ||
                  (ancestorNS != null && ancestorNS.equals(type.getNamespace())))) &&   // compare with ancestor
               type != fAnySimpleType) {  // reached anySimpleType
            type = (XSTypeDefinition)type.getBaseType();
        }

        return type != fAnySimpleType;
    }
View Full Code Here

          xsiType });
      return null;
    }

    // 4.2 The local name and namespace name (as defined in QName Interpretation (3.15.3)), of the actual value of that attribute information item must resolve to a type definition, as defined in QName resolution (Instance) (3.15.4)
    XSTypeDefinition type = null;
    // if the namespace is schema namespace, first try built-in types
    if (typeName.uri == SchemaSymbols.URI_SCHEMAFORSCHEMA) {
      type = SchemaGrammar.SG_SchemaNS.getGlobalTypeDecl(typeName.localpart);
    }
    // if it's not schema built-in types, then try to get a grammar
View Full Code Here

        short devMethod = 0, blockConstraint = blockingConstraint;

        // element.fType should be derived from exemplar.fType
        // add derivation methods of derived types to devMethod;
        // add block of base types to blockConstraint.
        XSTypeDefinition type = element.fType;
        while (type != exemplar.fType && type != SchemaGrammar.fAnyType) {
            if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
                devMethod |= ((XSComplexTypeDecl)type).fDerivedBy;
            else
                devMethod |= XSConstants.DERIVATION_RESTRICTION;
            type = type.getBaseType();
            // type == null means the current type is anySimpleType,
            // whose base type should be anyType
            if (type == null)
                type = SchemaGrammar.fAnyType;
            if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
                blockConstraint |= ((XSComplexTypeDecl)type).fBlock;
        }
        if (type != exemplar.fType)
            return false;
       
View Full Code Here

TOP

Related Classes of org.apache.xerces.xs.XSTypeDefinition

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.