Java Code Examples for com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar#fAnySimpleType()

The following examples show how to use com.sun.org.apache.xerces.internal.impl.xs.SchemaGrammar#fAnySimpleType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XSDSimpleTypeTraverser.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 2
Source File: XSDSimpleTypeTraverser.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 3
Source File: XSDSimpleTypeTraverser.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 4
Source File: XSDSimpleTypeTraverser.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 5
Source File: XSDSimpleTypeTraverser.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 6
Source File: XSDSimpleTypeTraverser.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 7
Source File: XSDSimpleTypeTraverser.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 8
Source File: XSDSimpleTypeTraverser.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 9
Source File: XSDSimpleTypeTraverser.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 10
Source File: XSDSimpleTypeTraverser.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}
 
Example 11
Source File: XSDSimpleTypeTraverser.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private XSSimpleType findDTValidator(Element elm, String refName,
        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) {
        return null;
    }
    if (baseType.getTypeCategory() != XSTypeDefinition.SIMPLE_TYPE) {
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    // if it's a complex type, or if its restriction of anySimpleType
    if (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 (checkBuiltIn(refName, schemaDoc.fTargetNamespace)) {
            return null;
        }
        reportSchemaError("cos-st-restricts.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        return null;
    }

    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);
        }
        else if (baseRefContext == XSConstants.DERIVATION_UNION) {
            reportSchemaError("cos-st-restricts.3.3.1.1", new Object[]{baseTypeStr.rawname, refName}, elm);
        }
        return null;
    }

    return (XSSimpleType)baseType;
}