Package com.sun.org.apache.xerces.internal.xs

Examples of com.sun.org.apache.xerces.internal.xs.XSTypeDefinition


            fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
            throw new ComplexTypeRecoverableError("s4s-att-must-appear",
                    new Object[]{complexContentName, "base"}, complexContent);
        }
       
        XSTypeDefinition type = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc,
                XSDHandler.TYPEDECL_TYPE,
                baseTypeName,
                complexContent);
       
        if (type==null) {
            fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
            fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
            throw new ComplexTypeRecoverableError();
        }
       
        if (! (type instanceof XSComplexTypeDecl)) {
            fAttrChecker.returnAttrArray(complexContentAttrValues, schemaDoc);
            fAttrChecker.returnAttrArray(derivationTypeAttrValues, schemaDoc);
            throw new ComplexTypeRecoverableError("src-ct.1",
                    new Object[]{fName, type.getName()}, complexContent);
        }
        XSComplexTypeDecl baseType = (XSComplexTypeDecl)type;
        fBaseType = baseType;
       
        // -----------------------------------------------------------------------
View Full Code Here


            QName baseTypeStr, short baseRefContext,
            XSDocumentInfo schemaDoc) {
        if (baseTypeStr == null)
            return null;

        XSTypeDefinition baseType = (XSTypeDefinition)fSchemaHandler.getGlobalDecl(schemaDoc, XSDHandler.TYPEDECL_TYPE, baseTypeStr, elm);
        if (baseType != null) {
            // if it's a complex type, or if its restriction of anySimpleType
            if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE ||
                    baseType == SchemaGrammar.fAnySimpleType &&
                    baseRefContext == XSConstants.DERIVATION_RESTRICTION) {
                // if the base type is anySimpleType and the current type is
                // a S4S built-in type, return null. (not an error).
                if (baseType == SchemaGrammar.fAnySimpleType &&
                        checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
                    return null;
                }
                reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
                return SchemaGrammar.fAnySimpleType;
            }
            if ((baseType.getFinal() & baseRefContext) != 0) {
                if (baseRefContext == XSConstants.DERIVATION_RESTRICTION) {
                    reportSchemaError("st-props-correct.3", new Object[]{refName, baseTypeStr.rawname}, elm);
                }
                else if (baseRefContext == XSConstants.DERIVATION_LIST) {
                    reportSchemaError("cos-st-restricts.2.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
View Full Code Here

            // otherwise push and pop won't be correctly paired.
            fXSIErrorReporter.pushContext();

            // get xsi:type
            if (xsiType != null) {
                XSTypeDefinition oldType = fCurrentType;
                fCurrentType = getAndCheckXsiType(element, xsiType, attributes);
                // If it fails, use the old type. Use anyType if ther is no old type.
                if (fCurrentType == null) {
                    if (oldType == null)
                        fCurrentType = SchemaGrammar.fAnyType;
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

            // TODO: make sure if this is correct.
            // TODO: since the number of types in a schema is quite limited,
            // TypeInfoImpl should be pooled. Even better, it should be a part
            // of the element decl.
            if( psvi.getValidity()== ElementPSVI.VALIDITY_VALID ) {
                XSTypeDefinition t = psvi.getMemberTypeDefinition();
                if (t != null) {
                    return (t instanceof TypeInfo) ? (TypeInfo) t : null;
                }
            }
           
            XSTypeDefinition t = psvi.getTypeDefinition();
            // TODO: can t be null?
            if (t != null) {
                return (t instanceof TypeInfo) ? (TypeInfo) t : null;
            }
            return null;
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

   */
  private boolean isDerivedByAny(String ancestorNS, String ancestorName,
      XSTypeDefinition type) {
   
    boolean derivedFrom = false;
    XSTypeDefinition oldType = null;
    // for each base, item or member type
    while (type != null && type != oldType)  {
     
      // If the ancestor type is reached or is the same as this type.
      if ((ancestorName.equals(type.getName()))
View Full Code Here

   *
   * @return boolean True if the type is derived by restriciton for the
   *         reference type
   */
  private boolean isDerivedByRestriction (String ancestorNS, String ancestorName, XSTypeDefinition type) {
        XSTypeDefinition oldType = null;
    while (type != null && type != oldType) {
      if ((ancestorName.equals(type.getName()))
          && ((ancestorNS != null && ancestorNS.equals(type.getNamespace()))
              || (type.getNamespace() == null && ancestorNS == null))) {
       
View Full Code Here

  private boolean isDerivedByList (String ancestorNS, String ancestorName, XSTypeDefinition type) {
    // If the variety is union
    if (type !=null && ((XSSimpleTypeDefinition)type).getVariety() == VARIETY_LIST) {
     
      // get the {item type}
      XSTypeDefinition itemType = ((XSSimpleTypeDefinition)type).getItemType();
     
      // T2 is the {item type definition}
      if (itemType != null) {
       
        // T2 is derived from the other type definition by DERIVATION_RESTRICTION
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xerces.internal.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.