Module dev.metaschema.core
Interface IAnyAtomicItem
- All Superinterfaces:
IAtomicValuedItem,ICollectionValue,IItem
- All Known Subinterfaces:
IAnyUriItem,IBase64BinaryItem,dev.metaschema.core.metapath.item.atomic.impl.IBinaryItem,IBooleanItem,ICalendarTemporalItem,IDateItem,IDateTimeItem,IDateTimeWithTimeZoneItem,IDateWithTimeZoneItem,IDayTimeDurationItem,IDecimalItem,IDurationItem,IEmailAddressItem,IHexBinaryItem,IHostnameItem,IIntegerItem,IIPAddressItem,IIPv4AddressItem,IIPv6AddressItem,IMarkupItem,IMarkupLineItem,IMarkupMultilineItem,INcNameItem,INonNegativeIntegerItem,INumericItem,IPositiveIntegerItem,IQNameItem,IStringItem,ITemporalItem,ITimeItem,ITimeWithTimeZoneItem,ITokenItem,IUntypedAtomicItem,IUriReferenceItem,IUuidItem,IYearMonthDurationItem
- All Known Implementing Classes:
AbstractAnyAtomicItem,AbstractAtomicItemBase,AbstractUntypedAtomicItem,NullJavaTypeAdapter.VoidItem
The interface shared by all atomic items, representing indivisible data
values that serve as the fundamental building blocks for complex data
structures in the Metaschema framework.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(IItemVisitor visitor) A visitor callback used to visit a variety of Metapath item types.asMapKey()Get the atomic item value as a map key for use with anIMapItem.asString()Get the item's string value.default IStringItemConverts this atomic item to a string item representation.default Stream<IAnyAtomicItem>atomize()Produce a stream of atomic items based on the atomic value of these items.static IAnyAtomicItemcast(IAnyAtomicItem item) Cast the provided type to this item type.castAsType(IAnyAtomicItem item) Cast the provideditemto be the same type as this item.booleandeepEquals(ICollectionValue other) Determine if this and the other value are deeply equal, without relying on the dynamic context.Get the item's type adapter.getValue()Get the "wrapped" value represented by this item.default IAnyAtomicItemGet the atomic value for the item.static IAtomicOrUnionType<?>type()Get the type information for this item.Methods inherited from interface dev.metaschema.core.metapath.item.ICollectionValue
deepEquals, toSignatureMethods inherited from interface dev.metaschema.core.metapath.item.IItem
contentsAsSequence, flatten, getType, hasValue, toSequence
-
Method Details
-
type
Get the type information for this item.- Returns:
- the type information
-
toAtomicItem
Description copied from interface:IItemGet the atomic value for the item. This may be the same item if the item is an instance ofIAnyAtomicItem.An implementation of item atomization.
- Specified by:
toAtomicItemin interfaceIItem- Returns:
- the atomic value or
nullif the item has no available value
-
getValue
Get the "wrapped" value represented by this item. -
asStringItem
Converts this atomic item to a string item representation.- Returns:
- a new
IStringItemcontaining the string representation of this item - See Also:
-
asString
Get the item's string value.- Returns:
- the string value value of the item
-
atomize
Description copied from interface:IItemProduce a stream of atomic items based on the atomic value of these items.Supports item atomization.
- Specified by:
atomizein interfaceICollectionValue- Specified by:
atomizein interfaceIItem- Returns:
- a stream of atomized atomic items.
-
asMapKey
Get the atomic item value as a map key for use with anIMapItem.- Returns:
- the map key
-
getJavaTypeAdapter
Get the item's type adapter.- Returns:
- the type adapter for the item
-
cast
Cast the provided type to this item type.This method simply returns the provided item, since it is already the same type.
- Parameters:
item- the item to cast- Returns:
- the provided item
-
castAsType
Cast the provideditemto be the same type as this item.- Parameters:
item- the item to cast- Returns:
- an atomic item of this type
- Throws:
InvalidValueForCastFunctionException- if the provided item type cannot be cast to this item type
-
deepEquals
Determine if this and the other value are deeply equal, without relying on the dynamic context.This is used by
IMapKey.isSameKey(IMapKey)to determine key equivalence.Item equality is defined by the XPath 3.1 fn:deep-equal specification.
- Parameters:
other- the other value to compare to this value to- Returns:
- the
trueif the two values are equal, orfalseotherwise
-
accept
Description copied from interface:IItemA visitor callback used to visit a variety of Metapath item types.
-