/** * Returns the base type that this type inherits from. This method can be used to get the * base type of a type that is known to be valid. * If this type is a Simpletype that is a built in primitive type then null is returned. * * @return the base type. * @throws IllegalStateException if this type is not valid. */ /*@Nullable*/ public SchemaType getKnownBaseType() { return getBaseType(); }
/** * Returns the base type that this type inherits from. This method can be used to get the * base type of a type that is known to be valid. * If this type is a Simpletype that is a built in primitive type then null is returned. * * @return the base type. * @throws IllegalStateException if this type is not valid. */ public SchemaType getKnownBaseType() { return getBaseType(); }
/** * Returns the base type that this type inherits from. This method can be used to get the * base type of a type that is known to be valid. * If this type is a Simpletype that is a built in primitive type then null is returned. * * @return the base type. * @throws IllegalStateException if this type is not valid. */ public SchemaType getKnownBaseType() { return getBaseType(); }
/** * Returns the base type that this type inherits from. This method can be used to get the * base type of a type that is known to be valid. * If this type is a Simpletype that is a built in primitive type then null is returned. * * @return the base type. * @throws IllegalStateException if this type is not valid. */ /*@Nullable*/ public SchemaType getKnownBaseType() { return getBaseType(); }
/** * Returns the built-in base type this type is derived from. * * @return the first built-in type found when searching up the type hierarchy */ /*@Nullable*/ public SchemaType getBuiltInBaseType() { BuiltInAtomicType base = this; while ((base != null) && (base.getFingerprint() > 1023)) { base = (BuiltInAtomicType) base.getBaseType(); } return base; }
/** * Returns the built-in base type this type is derived from. * * @return the first built-in type found when searching up the type hierarchy */ public SchemaType getBuiltInBaseType() { BuiltInAtomicType base = this; while ((base != null) && (base.getFingerprint() > 1023)) { base = (BuiltInAtomicType)base.getBaseType(); } return base; }
/** * Returns the built-in base type this type is derived from. * * @return the first built-in type found when searching up the type hierarchy */ public SchemaType getBuiltInBaseType() { BuiltInAtomicType base = this; while ((base != null) && (base.getFingerprint() > 1023)) { base = (BuiltInAtomicType)base.getBaseType(); } return base; }
/** * Returns the built-in base type this type is derived from. * * @return the first built-in type found when searching up the type hierarchy */ /*@Nullable*/ public SchemaType getBuiltInBaseType() { BuiltInAtomicType base = this; while ((base != null) && (base.getFingerprint() > 1023)) { base = (BuiltInAtomicType) base.getBaseType(); } return base; }
/** * Get the type from which this item type is derived by restriction. This * is the supertype in the XPath type heirarchy, as distinct from the Schema * base type: this means that the supertype of xs:boolean is xs:anyAtomicType, * whose supertype is item() (rather than xs:anySimpleType). * * @param th the type hierarchy cache, not used in this implementation * @return the supertype, or null if this type is item() */ public ItemType getSuperType(TypeHierarchy th) { SchemaType base = getBaseType(); if (base instanceof AnySimpleType) { return AnyItemType.getInstance(); } else { return (ItemType)base; } }
/** * Get the type from which this item type is derived by restriction. This * is the supertype in the XPath type heirarchy, as distinct from the Schema * base type: this means that the supertype of xs:boolean is xs:anyAtomicType, * whose supertype is item() (rather than xs:anySimpleType). * * @param th the type hierarchy cache, not used in this implementation * @return the supertype, or null if this type is item() */ public ItemType getSuperType(TypeHierarchy th) { SchemaType base = getBaseType(); if (base instanceof AnySimpleType) { return AnyItemType.getInstance(); } else { return (ItemType)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; } }
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; } }
/** * Test whether this simple type is namespace-sensitive, that is, whether * it is derived from xs:QName or xs:NOTATION * * @return true if this type is derived from xs:QName or xs:NOTATION */ public boolean isNamespaceSensitive() { BuiltInAtomicType base = this; int fp = base.getFingerprint(); while (fp > 1023) { base = (BuiltInAtomicType)base.getBaseType(); fp = base.getFingerprint(); } return fp == StandardNames.XS_QNAME || fp == StandardNames.XS_NOTATION; }
/** * Test whether this simple type is namespace-sensitive, that is, whether * it is derived from xs:QName or xs:NOTATION * * @return true if this type is derived from xs:QName or xs:NOTATION */ public boolean isNamespaceSensitive() { BuiltInAtomicType base = this; int fp = base.getFingerprint(); while (fp > 1023) { base = (BuiltInAtomicType)base.getBaseType(); fp = base.getFingerprint(); } return fp == StandardNames.XS_QNAME || fp == StandardNames.XS_NOTATION; }
/** * Test whether this simple type is namespace-sensitive, that is, whether * it is derived from xs:QName or xs:NOTATION. Note that * the result for xs:anyAtomicType is false, even though an instance might be a QName. * * @return true if this type is derived from xs:QName or xs:NOTATION */ public boolean isNamespaceSensitive() { BuiltInAtomicType base = this; int fp = base.getFingerprint(); while (fp > 1023) { base = (BuiltInAtomicType) base.getBaseType(); assert base != null; fp = base.getFingerprint(); } return fp == StandardNames.XS_QNAME || fp == StandardNames.XS_NOTATION; }
/** * Test whether this simple type is namespace-sensitive, that is, whether * it is derived from xs:QName or xs:NOTATION. Note that * the result for xs:anyAtomicType is false, even though an instance might be a QName. * * @return true if this type is derived from xs:QName or xs:NOTATION */ public boolean isNamespaceSensitive() { BuiltInAtomicType base = this; int fp = base.getFingerprint(); while (fp > 1023) { base = (BuiltInAtomicType) base.getBaseType(); assert base != null; fp = base.getFingerprint(); } return fp == StandardNames.XS_QNAME || fp == StandardNames.XS_NOTATION; }
/** * Get the primitive item type corresponding to this item type. For item(), * this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, * it is the value representing the node kind, for example Type.ELEMENT. * For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER. * For other atomic types it is the primitive type as defined in XML Schema, * except that INTEGER is considered to be a primitive type. */ /*@NotNull*/ public BuiltInAtomicType getPrimitiveItemType() { if (isPrimitiveType()) { return this; } else { ItemType s = (ItemType) getBaseType(); assert s != null; if (s.isPlainType()) { return (BuiltInAtomicType)s.getPrimitiveItemType(); } else { return this; } } }
/** * Get the primitive item type corresponding to this item type. For item(), * this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, * it is the value representing the node kind, for example Type.ELEMENT. * For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER. * For other atomic types it is the primitive type as defined in XML Schema, * except that INTEGER is considered to be a primitive type. */ public ItemType getPrimitiveItemType() { if (isPrimitiveType()) { return this; } else { ItemType s = (ItemType)getBaseType(); if (s.isAtomicType()) { return s.getPrimitiveItemType(); } else { return this; } } }
/** * Get the primitive item type corresponding to this item type. For item(), * this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, * it is the value representing the node kind, for example Type.ELEMENT. * For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER. * For other atomic types it is the primitive type as defined in XML Schema, * except that INTEGER is considered to be a primitive type. */ public ItemType getPrimitiveItemType() { if (isPrimitiveType()) { return this; } else { ItemType s = (ItemType)getBaseType(); if (s.isAtomicType()) { return s.getPrimitiveItemType(); } else { return this; } } }
/** * Get the primitive item type corresponding to this item type. For item(), * this is Type.ITEM. For node(), it is Type.NODE. For specific node kinds, * it is the value representing the node kind, for example Type.ELEMENT. * For anyAtomicValue it is Type.ATOMIC_VALUE. For numeric it is Type.NUMBER. * For other atomic types it is the primitive type as defined in XML Schema, * except that INTEGER is considered to be a primitive type. */ /*@NotNull*/ public BuiltInAtomicType getPrimitiveItemType() { if (isPrimitiveType()) { return this; } else { ItemType s = (ItemType) getBaseType(); assert s != null; if (s.isPlainType()) { return (BuiltInAtomicType)s.getPrimitiveItemType(); } else { return this; } } }