- All Superinterfaces:
ICollectionValue
- All Known Subinterfaces:
IAnyAtomicItem,IAnyUriItem,IArrayItem<ITEM>,IAssemblyInstanceGroupedNodeItem,IAssemblyNodeItem,IAtomicValuedItem,IAtomicValuedNodeItem,IBase64BinaryItem,dev.metaschema.core.metapath.item.atomic.impl.IBinaryItem,IBooleanItem,ICalendarTemporalItem,ICycledAssemblyNodeItem,IDateItem,IDateTimeItem,IDateTimeWithTimeZoneItem,IDateWithTimeZoneItem,IDayTimeDurationItem,IDecimalItem,IDefinitionNodeItem<D,,I> IDocumentBasedNodeItem,IDocumentNodeItem,IDurationItem,IEmailAddressItem,IFeatureChildNodeItem,IFeatureFlagContainerItem,IFeatureModelContainerItem,IFeatureNoDataAtomicValuedItem,IFeatureNoDataValuedItem,IFeatureOrhpanedDefinitionNodeItem<D,,I> IFieldNodeItem,IFlagNodeItem,IFunction,IHexBinaryItem,IHostnameItem,IIntegerItem,IIPAddressItem,IIPv4AddressItem,IIPv6AddressItem,IMapItem<VALUE>,IMarkupItem,IMarkupLineItem,IMarkupMultilineItem,IModelNodeItem<D,,I> IModuleNodeItem,INcNameItem,INodeItem,INonNegativeIntegerItem,INumericItem,IPositiveIntegerItem,IQNameItem,IRootAssemblyNodeItem,IStringItem,ITemporalItem,ITimeItem,ITimeWithTimeZoneItem,ITokenItem,IUntypedAtomicItem,IUriReferenceItem,IUuidItem,IYearMonthDurationItem
- All Known Implementing Classes:
AbstractAnyAtomicItem,AbstractAtomicItemBase,AbstractDefinitionNodeItem,AbstractFlagInstanceNodeItem,dev.metaschema.core.metapath.function.impl.AbstractFunction,AbstractGlobalDefinitionNodeItem,AbstractInstanceNodeItem,AbstractNodeItem,AbstractOrphanedDefinitionNodeItem,AbstractUntypedAtomicItem,DefaultFunction,NullJavaTypeAdapter.VoidItem
The base interface inherited by all Metapath item implementations.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IItemVisitor visitor) A visitor callback used to visit a variety of Metapath item types.default Stream<IAnyAtomicItem>atomize()Produce a stream of atomic items based on the atomic value of these items.default ISequence<?>Get the collection value as a sequence.flatten()Get the stream of items for the collection value.getType()Get the type information for the item.getValue()Get the item's "wrapped" value.default booleanhasValue()Determine if the item has an associated value.Get the atomic value for the item.default ISequence<?>Get the collection value as a sequence.static IItemTypetype()Get the type information for this item.Methods inherited from interface dev.metaschema.core.metapath.item.ICollectionValue
deepEquals, toSignature
-
Method Details
-
type
Get the type information for this item.- Returns:
- the type information
-
getType
Get the type information for the item.- Returns:
- the item's type information
-
getValue
Object getValue()Get the item's "wrapped" value. This "wrapped" value may be:- In the case of an Assembly, a Java object representing the fields and flags of the assembly.
- In the case of a Field with flags, a Java object representing the field value and flags of the field.
- In the case of a Field without flags or a flag, a Java type managed by a
IDataTypeAdapteror a primitive type provided by the Java standard library.
- Returns:
- the value or
nullif the item has no available value
-
hasValue
default boolean hasValue()Determine if the item has an associated value.- Returns:
trueif the item has a non-nullvalue orfalseotherwise
-
toSequence
Description copied from interface:ICollectionValueGet the collection value as a sequence.If the value is already a sequence, the value is returned as a sequence. Otherwise, if the value is an item, a new sequence will be created containing only that item.
- Specified by:
toSequencein interfaceICollectionValue- Returns:
- the resulting sequence
-
toAtomicItem
IAnyAtomicItem toAtomicItem()Get the atomic value for the item. This may be the same item if the item is an instance ofIAnyAtomicItem.An implementation of item atomization.
- Returns:
- the atomic value or
nullif the item has no available value - Throws:
InvalidTypeFunctionException- with codeInvalidTypeFunctionException.NODE_HAS_NO_TYPED_VALUEif the item does not have a typed value
-
atomize
Produce a stream of atomic items based on the atomic value of these items.Supports item atomization.
- Specified by:
atomizein interfaceICollectionValue- Returns:
- a stream of atomized atomic items.
- Throws:
InvalidTypeFunctionException- with codeInvalidTypeFunctionException.NODE_HAS_NO_TYPED_VALUEif the item does not have a typed value
-
flatten
Description copied from interface:ICollectionValueGet the stream of items for the collection value.If the collection value contains items, then these items are returned.
- Specified by:
flattenin interfaceICollectionValue- Returns:
- a stream of related items
-
accept
A visitor callback used to visit a variety of Metapath item types.- Parameters:
visitor- the visitor to call back
-
contentsAsSequence
Description copied from interface:ICollectionValueGet the collection value as a sequence.If the value is already a sequence, the value is returned as a sequence. Otherwise, if the value is an item, what is returned depends on the item type:
IArrayItemorIMapItem: the contents of the returned sequence are the items of the array or map. Any member values that are a sequence are flattened.- Any other item: A singleton sequence is returned containing the item.
- Specified by:
contentsAsSequencein interfaceICollectionValue- Returns:
- the resulting sequence
-