Java Code Examples for com.sun.xml.internal.xsom.XSType#RESTRICTION

The following examples show how to use com.sun.xml.internal.xsom.XSType#RESTRICTION . 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: AbstractExtendedComplexTypeBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
Example 2
Source File: AbstractExtendedComplexTypeBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
Example 3
Source File: AbstractExtendedComplexTypeBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
Example 4
Source File: AbstractExtendedComplexTypeBuilder.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
Example 5
Source File: AbstractExtendedComplexTypeBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Looks for the derivation chain t_1 > t_2 > ... > t
 * and find t_i such that t_i derives by restriction but
 * for every j>i, t_j derives by extension.
 *
 * @return null
 *      If there's no such t_i or if t_i is any type.
 */
protected XSComplexType getLastRestrictedType(XSComplexType t) {
    if (t.getBaseType() == schemas.getAnyType()) {
        return null;   // we don't count the restriction from anyType
    }
    if (t.getDerivationMethod() == XSType.RESTRICTION) {
        return t;
    }

    XSComplexType baseType = t.getBaseType().asComplexType();
    if (baseType != null) {
        return getLastRestrictedType(baseType);
    } else {
        return null;
    }
}
 
Example 6
Source File: ElementDecl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
Example 7
Source File: ElementDecl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
Example 8
Source File: ElementDecl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
Example 9
Source File: ElementDecl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
Example 10
Source File: ElementDecl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void updateSubstitutabilityMap() {
    ElementDecl parent = this;
    XSType type = this.getType();

    boolean rused = false;
    boolean eused = false;

    while( (parent=(ElementDecl)parent.getSubstAffiliation())!=null ) {

        if(parent.isSubstitutionDisallowed(XSType.SUBSTITUTION))
            continue;

        boolean rd = parent.isSubstitutionDisallowed(XSType.RESTRICTION);
        boolean ed = parent.isSubstitutionDisallowed(XSType.EXTENSION);

        if( (rd && rused) || ( ed && eused ) )   continue;

        XSType parentType = parent.getType();
        while (type!=parentType) {
            if(type.getDerivationMethod()==XSType.RESTRICTION)  rused = true;
            else                                                eused = true;

            type = type.getBaseType();
            if(type==null)  // parentType and type doesn't share the common base type. a bug in the schema.
                break;

            if( type.isComplexType() ) {
                rd |= type.asComplexType().isSubstitutionProhibited(XSType.RESTRICTION);
                ed |= type.asComplexType().isSubstitutionProhibited(XSType.EXTENSION);
            }
            if (getRoot().getAnyType().equals(type)) break;
        }

        if( (rd && rused) || ( ed && eused ) )   continue;

        // this element can substitute "parent"
        parent.addSubstitutable(this);
    }
}
 
Example 11
Source File: RestrictedComplexTypeBuilder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.RESTRICTION;
}
 
Example 12
Source File: RestrictedComplexTypeBuilder.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.RESTRICTION;
}
 
Example 13
Source File: RestrictedComplexTypeBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    XSType baseType = ct.getBaseType();
    return baseType!=schemas.getAnyType()
        &&  baseType.isComplexType()
        &&  ct.getDerivationMethod()==XSType.RESTRICTION;
}
 
Example 14
Source File: SchemaSetImpl.java    From openjdk-8-source with GNU General Public License v2.0 votes vote down vote up
public int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 15
Source File: SchemaSetImpl.java    From TencentKona-8 with GNU General Public License v2.0 votes vote down vote up
public int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 16
Source File: SimpleTypeImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 votes vote down vote up
public final int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 17
Source File: SchemaSetImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 votes vote down vote up
public int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 18
Source File: SimpleTypeImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 votes vote down vote up
public final int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 19
Source File: SchemaSetImpl.java    From jdk8u60 with GNU General Public License v2.0 votes vote down vote up
public int getDerivationMethod() { return XSType.RESTRICTION; } 
Example 20
Source File: SimpleTypeImpl.java    From hottub with GNU General Public License v2.0 votes vote down vote up
public final int getDerivationMethod() { return XSType.RESTRICTION; }