private boolean subsumesUnderlyingType(AtomicType type) { BuiltInAtomicType builtIn = type instanceof BuiltInAtomicType ? (BuiltInAtomicType) type : (BuiltInAtomicType) type.getBuiltInBaseType(); while (true) { if (builtIn.isSameType(underlyingType)) { return true; } SchemaType base = builtIn.getBaseType(); if (!(base instanceof BuiltInAtomicType)) { return false; } builtIn = (BuiltInAtomicType) base; } }
private boolean subsumesUnderlyingType(AtomicType type) { BuiltInAtomicType builtIn = type instanceof BuiltInAtomicType ? (BuiltInAtomicType) type : (BuiltInAtomicType) type.getBuiltInBaseType(); while (true) { if (builtIn.isSameType(underlyingType)) { return true; } SchemaType base = builtIn.getBaseType(); if (!(base instanceof BuiltInAtomicType)) { return false; } builtIn = (BuiltInAtomicType) base; } }
/** * Check that this type is validly derived from a given type * * @param type the type from which this type is derived * @param block the derivations that are blocked by the relevant element declaration * @throws SchemaException if the derivation is not allowed */ public void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException { if (type == AnySimpleType.getInstance()) { // OK } else if (isSameType(type)) { // OK } else { SchemaType base = getBaseType(); if (base == null) { throw new SchemaException("The type " + getDescription() + " is not validly derived from the type " + type.getDescription()); } try { base.checkTypeDerivationIsOK(type, block); } catch (SchemaException se) { throw new SchemaException("The type " + getDescription() + " is not validly derived from the type " + type.getDescription()); } } }
/** * Check that this type is validly derived from a given type * * @param type the type from which this type is derived * @param block the derivations that are blocked by the relevant element declaration * @throws SchemaException if the derivation is not allowed */ public void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException { if (type == AnySimpleType.getInstance()) { // OK } else if (isSameType(type)) { // OK } else { SchemaType base = getBaseType(); if (base == null) { throw new SchemaException("Type " + getDescription() + " is not validly derived from " + type.getDescription()); } try { base.checkTypeDerivationIsOK(type, block); } catch (SchemaException se) { throw new SchemaException("Type " + getDescription() + " is not validly derived from " + type.getDescription()); } } }
/** * Check that this type is validly derived from a given type * * @param type the type from which this type is derived * @param block the derivations that are blocked by the relevant element declaration * @throws SchemaException if the derivation is not allowed */ public void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException { if (type == AnySimpleType.getInstance()) { // OK } else if (isSameType(type)) { // OK } else { SchemaType base = getBaseType(); if (base == null) { throw new SchemaException("The type " + getDescription() + " is not validly derived from the type " + type.getDescription()); } try { base.checkTypeDerivationIsOK(type, block); } catch (SchemaException se) { throw new SchemaException("The type " + getDescription() + " is not validly derived from the type " + type.getDescription()); } } }
/** * Check that this type is validly derived from a given type * * @param type the type from which this type is derived * @param block the derivations that are blocked by the relevant element declaration * @throws SchemaException if the derivation is not allowed */ public void checkTypeDerivationIsOK(SchemaType type, int block) throws SchemaException { if (type == AnySimpleType.getInstance()) { // OK } else if (isSameType(type)) { // OK } else { SchemaType base = getBaseType(); if (base == null) { throw new SchemaException("Type " + getDescription() + " is not validly derived from " + type.getDescription()); } try { base.checkTypeDerivationIsOK(type, block); } catch (SchemaException se) { throw new SchemaException("Type " + getDescription() + " is not validly derived from " + type.getDescription()); } } }