Package org.rumbledb.types
Class ItemTypeReference
java.lang.Object
org.rumbledb.types.AbstractItemType
org.rumbledb.types.ItemTypeReference
- All Implemented Interfaces:
Serializable,ItemType
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBePromotedTo(ItemType itemType) protected ObjectFinds a lax (non-strict) common supertype that can incorporate anonymous facets when possible.booleangetName()Returns the pattern facet for this item type.getTypes()intbooleanhasName()Tests for QName.booleanbooleanbooleanisCompatibleWithDataFrames(RumbleConfiguration configuration) Checks compatibility with DataFrames.booleanbooleanbooleanbooleanbooleanbooleanbooleanisStaticallyCastableAs(ItemType other) Check at static time if [this] could be casted to [other] item type, requires [this] to be an atomic typebooleanisSubtypeOf(ItemType superType) booleanbooleanstatic NamerenameAtomic(StaticContext context, Name oldName) in jsoniq 1.0 anyAtomicType was called atomic.voidresolve(DynamicContext context, ExceptionMetadata metadata) voidresolve(StaticContext context, ExceptionMetadata metadata) toString()Methods inherited from class org.rumbledb.types.AbstractItemType
equalityKeyOf, equals, hashCode, namedTypeKey, structuralTypeKeyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.rumbledb.types.ItemType
canBeNull, getCastingPrimitiveType, getLexicalSpacePatterns, getMapKeyItemType, getMapValueSequenceType, getMemberSequenceType, getSingleNullableType, getSparkSQLType, isCastingPrimitive, isEqualTo, isMapItemType, isNodeItemType, isTopmostItemType, isXQueryArrayItemType
-
Constructor Details
-
ItemTypeReference
-
-
Method Details
-
isResolved
public boolean isResolved() -
resolve
-
resolve
-
renameAtomic
in jsoniq 1.0 anyAtomicType was called atomic. This function gives backwards compatibility by replacing atomic with anyAtomicType depending on the jsoniq version. -
getTypeTreeDepth
public int getTypeTreeDepth()- Returns:
- an int representing the depth of the item type in the type tree ('item' is the root with depth 0)
-
getBaseType
- Returns:
- the base type for a type, return null for the topmost item type
-
getAllowedFacets
- Returns:
- a set containing the allowed facets for restricting the type
-
equalityKey
- Overrides:
equalityKeyin classAbstractItemType
-
isAtomicItemType
public boolean isAtomicItemType()- Returns:
- true it [this] is a subtype of an atomic item type.
-
isObjectItemType
public boolean isObjectItemType()- Returns:
- true it [this] is an object item type.
-
isArrayItemType
public boolean isArrayItemType()- Returns:
- true it [this] is an array item type.
-
isJsonItemType
public boolean isJsonItemType()- Returns:
- test if [this] is a subptype of a json item type
-
isUnionType
public boolean isUnionType() -
isFunctionItemType
public boolean isFunctionItemType()- Returns:
- true it [this] is a function item type.
-
isNumeric
public boolean isNumeric()- Returns:
- [true] if this is a numeric item type, false otherwise
-
hasName
public boolean hasName()Description copied from interface:ItemTypeTests for QName.- Returns:
- true if [this] item type has a QName
-
getName
- Returns:
- the itemtype QName if available
-
getSignature
- Returns:
- the signature of the function item type if available
-
isSubtypeOf
- Parameters:
superType- another item type- Returns:
- true if [this] is a subtype of [superType], any type is considered a subtype of itself. If [this] has a name, then this is determined strictly based on the hierarchy. If [this] does not have a name, then this is determined based on facets.
-
findLeastCommonSuperTypeWith
- Parameters:
other- another item type- Returns:
- the common supertype between [this] and [other], that would be the LCA in the item type tree of [this] and [other] (does not take into account union types as common ancestor, but only the type tree)
-
findLeastCommonSuperTypeLax
Description copied from interface:ItemTypeFinds a lax (non-strict) common supertype that can incorporate anonymous facets when possible. The default implementation falls back to the strict least-common-supertype logic.- Parameters:
other- another item type- Returns:
- a lax common supertype between [this] and [other]
-
isStaticallyCastableAs
Description copied from interface:ItemTypeCheck at static time if [this] could be casted to [other] item type, requires [this] to be an atomic type- Parameters:
other- a strict subtype of atomic item type to which we are trying to cast- Returns:
- true if it is possible at static time to cast [this] to [other], false otherwise
-
canBePromotedTo
- Parameters:
itemType- another item type- Returns:
- true if [this] can be promoted to [itemType]
-
isUserDefined
public boolean isUserDefined()- Returns:
- [true] if it is a user-defined type, false otherwise
-
isPrimitive
public boolean isPrimitive()- Returns:
- [true] if it is a primitive type
-
getPrimitiveType
- Returns:
- the primitive type for a derived type, throw an error for primitive types
-
getEnumerationFacet
- Returns:
- the list of possible values for [this] item type or null if the enumeration facet is not set
-
getConstraintsFacet
- Returns:
- the list of constraints in the implementation-defined language for [this] item type (note that this facet is cumulative) or an empty list if the constraints facet is not set
-
getMinLengthFacet
- Returns:
- the minimum length facet value for [this] item type or null if the restriction is not set
-
getLengthFacet
- Returns:
- the length facet value for [this] item type or null if the restriction is not set
-
getMaxLengthFacet
- Returns:
- the maximum length facet value for [this] item type or null if the restriction is not set
-
getMinExclusiveFacet
- Returns:
- an item representing the minimum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMinInclusiveFacet
- Returns:
- an item representing the minimum possible value (included) for [this] item type or null if the restriction is not set
-
getMaxExclusiveFacet
- Returns:
- an item representing the maximum possible value (excluded) for [this] item type or null if the restriction is not set
-
getMaxInclusiveFacet
- Returns:
- an item representing the maximum possible value (included) for [this] item type or null if the restriction is not set
-
getTotalDigitsFacet
- Returns:
- the total digits facet value for [this] item type or null if the restriction is not set
-
getFractionDigitsFacet
- Returns:
- the fraction digits facet value for [this] item type or null if the restriction is not set
-
getExplicitTimezoneFacet
- Returns:
- the explicit timezone facet value for [this] item type or null if the restriction is not set
-
getWhitespaceFacet
- Returns:
- the whiteSpace facet value for [this] item type or null if the restriction is not set
-
getPatternFacet
Description copied from interface:ItemTypeReturns the pattern facet for this item type. This reflects pattern facets applied via derivation (for example onDerivedAtomicItemType), not the full lexical space of a primitive atomic type.- Returns:
- the list of pattern regex strings for this derivation step, or null if no pattern restriction is set
-
getOrderedFacet
- Returns:
- the ordered fundamental facet value, or null if not set
-
getBoundedFacet
- Returns:
- the bounded fundamental facet value, or null if not set
-
getCardinalityFacet
- Returns:
- the cardinality fundamental facet value, or null if not set
-
getNumericFacet
- Returns:
- the numeric fundamental facet value, or null if not set
-
getObjectKeysFacet
-
getObjectContentFacet
-
getObjectContentFacet
-
getObjectContentFacetAsUnorderedMap
-
getClosedFacet
public boolean getClosedFacet()- Returns:
- closed facet value for object item types
-
getArrayContentFacet
- Returns:
- content facet value for array item types
-
getTypes
- Returns:
- content facet value for union item types
-
getIdentifierString
- Returns:
- a String that uniquely identify an item type
-
toString
-
isCompatibleWithDataFrames
Description copied from interface:ItemTypeChecks compatibility with DataFrames.- Returns:
- true if compatible with DataFrames and false otherwise.
-