- All Superinterfaces:
ICollectionValue,IItem,IMetapathQueryable,INodeItemVisitable,IPathSegment
- All Known Subinterfaces:
IAssemblyInstanceGroupedNodeItem,IAssemblyNodeItem,IAtomicValuedNodeItem,ICycledAssemblyNodeItem,IDefinitionNodeItem<D,,I> IDocumentBasedNodeItem,IDocumentNodeItem,IFeatureChildNodeItem,IFeatureFlagContainerItem,IFeatureModelContainerItem,IFeatureOrhpanedDefinitionNodeItem<D,,I> IFieldNodeItem,IFlagNodeItem,IModelNodeItem<D,,I> IModuleNodeItem,IRootAssemblyNodeItem
- All Known Implementing Classes:
AbstractDefinitionNodeItem,AbstractFlagInstanceNodeItem,AbstractGlobalDefinitionNodeItem,AbstractInstanceNodeItem,AbstractNodeItem,AbstractOrphanedDefinitionNodeItem
Represents a Metapath model node.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(IItemVisitor visitor) A visitor callback used to visit a variety of Metapath item types.ancestor()Get a stream of all ancestors of this node item.Get a stream of this and all ancestors of this node item.ancestorsOf(INodeItem item) Get a stream of the ancestors of the provideditem.static Stream<? extends IModelNodeItem<?,?>> decendantsOf(INodeItem item) Get a stream of all descendant model items of the provideditem.default Stream<? extends IModelNodeItem<?,?>> Get a stream of all descendant model items of this node item.Get a stream of this node, followed by all descendant model items of this node item.default Stream<? extends IFlagNodeItem>flags()Get the flags and value data associated with this node as a stream.default Stream<? extends IModelNodeItem<?,?>> Get the children of this node's parent, and their descendants, that occur before this node in a depth-first order.default Stream<? extends IModelNodeItem<?,?>> Get the children of this node's parent that occur after this node in a depth-first order.format(IPathFormatter formatter) Generate a path for this node in the directed node graph, using the provided path formatter.Retrieve the base URI of this node.getFlagByName(IEnhancedQName name) Lookup a flag and value data on this node by it's effective qualified name.Collection<? extends IFlagNodeItem>getFlags()Get the flags and value data associated this node.Get the resource location information for the node, if known.default StringGet the path for this node item as a Metapath.Collection<? extends List<? extends IModelNodeItem<?,?>>> Get the model items (i.e., fields, assemblies) and value data associated this node.List<? extends IModelNodeItem<?,?>> Get the collection of model items associated with the instance having the providedname.Get the kind of node item this is.Get the node type for the node item.IModelNodeItem<?,?> Retrieve the parent content node item if it exists.Retrieve the parent node item if it exists.Get a stream of path segments, starting at the root and descending.default intRetrieve the relative position of this node relative to sibling nodes.Get the static context to use to query this node item.default Stream<? extends IModelNodeItem<?,?>> Get the model items (i.e., fields, assemblies) and value data associated this node as a stream.default Stream<? extends IModelNodeItem<?,?>> Get the children of this node's parent, and their descendants, that occur after this node in a depth-first order.default Stream<? extends IModelNodeItem<?,?>> Get the children of this node's parent, and their descendants, that occur before this node in a depth-first order.Get the string value of the node.static <CLASS> CLASSGets the value of the provided node item.static IItemTypetype()Get the static type information of the node item.Methods inherited from interface dev.metaschema.core.metapath.item.ICollectionValue
deepEquals, toSignatureMethods inherited from interface dev.metaschema.core.metapath.item.IItem
atomize, contentsAsSequence, flatten, getType, getValue, hasValue, toAtomicItem, toSequenceMethods inherited from interface dev.metaschema.core.metapath.item.node.INodeItemVisitable
acceptMethods inherited from interface dev.metaschema.core.metapath.format.IPathSegment
getNodeItem, getPath, toPath
-
Method Details
-
getNodeType
Get the node type for the node item.- Returns:
- the node type
-
type
Get the static type information of the node item.- Returns:
- the item type
-
getPosition
default int getPosition()Retrieve the relative position of this node relative to sibling nodes.A singleton item in a sequence will have a position value of
1.The value
1is used as the starting value to align with the XPath specification.- Returns:
- a positive integer value designating this instance's position within a collection
-
format
Generate a path for this node in the directed node graph, using the provided path formatter.- Specified by:
formatin interfaceIPathSegment- Parameters:
formatter- the path formatter- Returns:
- a textual representation of the path segment
-
toValue
Gets the value of the provided node item.If the provided node item is a document, this method get the first child node item's value, since a document doesn't have a value.
- Type Parameters:
CLASS- the type of the bound object to return- Parameters:
item- the node item to get the value of- Returns:
- a bound object
- Throws:
NullPointerException- if the node item has no associated value
-
getParentNodeItem
INodeItem getParentNodeItem()Retrieve the parent node item if it exists.- Returns:
- the parent node item, or
nullif this node item has no known parent
-
getParentContentNodeItem
IModelNodeItem<?,?> getParentContentNodeItem()Retrieve the parent content node item if it exists. A content node is a non-document node.- Returns:
- the parent content node item, or
nullif this node item has no known parent content node item
-
getNodeItemKind
Get the kind of node item this is.- Returns:
- the node item's kind
-
getBaseUri
URI getBaseUri()Retrieve the base URI of this node.The base URI of a node will be in order of preference:
- the base URI defined on the node
- the base URI defined on the nearest ancestor node
- the base URI defined on the document node
nullif the document node is unknown
- Returns:
- the base URI or
nullif it is unknown
-
getMetapath
Get the path for this node item as a Metapath.- Returns:
- the Metapath
-
getPathStream
Description copied from interface:IPathSegmentGet a stream of path segments, starting at the root and descending.- Specified by:
getPathStreamin interfaceIPathSegment- Returns:
- a stream of path segments in descending order
-
ancestor
Get a stream of all ancestors of this node item. The stream is ordered from closest to farthest ancestor.- Returns:
- a stream of ancestor node items
-
ancestorOrSelf
Get a stream of this and all ancestors of this node item. The stream is ordered from self, then closest to farthest ancestor.- Returns:
- a stream of this node followed by all ancestor node items
-
ancestorsOf
Get a stream of the ancestors of the provideditem. The stream is ordered from the farthest ancestor to the closest.- Parameters:
item- the target item to get ancestors for- Returns:
- a stream of all ancestor node items
-
descendant
Get a stream of all descendant model items of this node item. The stream is ordered from closest to farthest descendants in a depth-first order.- Returns:
- a stream of descendant node items
-
decendantsOf
Get a stream of all descendant model items of the provideditem. The stream is ordered from closest to farthest descendants in a depth-first order.- Parameters:
item- the target item to get descendants for- Returns:
- a stream of descendant node items
-
descendantOrSelf
Get a stream of this node, followed by all descendant model items of this node item. The stream is ordered from closest to farthest descendants in a depth-first order.- Returns:
- a stream of this node and descendant node items
-
followingSibling
Get the children of this node's parent that occur after this node in a depth-first order.- Returns:
- a stream of nodes
-
precedingSibling
Get the children of this node's parent, and their descendants, that occur before this node in a depth-first order.- Returns:
- a stream of nodes
-
following
Get the children of this node's parent, and their descendants, that occur before this node in a depth-first order.- Returns:
- a stream of nodes
-
preceding
Get the children of this node's parent, and their descendants, that occur after this node in a depth-first order.- Returns:
- a stream of nodes
-
getFlags
Get the flags and value data associated this node. The resulting collection is expected to be ordered, with the results in document order.The resulting collection may be modified, but such modification is not thread safe
- Returns:
- a collection of flags
-
getFlagByName
Lookup a flag and value data on this node by it's effective qualified name.- Parameters:
name- the effective qualified name of the flag- Returns:
- the flag with the matching effective name or
nullif no match was found
-
flags
Get the flags and value data associated with this node as a stream.- Returns:
- the stream of flags or an empty stream if none exist
-
getModelItems
Get the model items (i.e., fields, assemblies) and value data associated this node. A given model instance can be multi-valued, so the value of each instance will be a list. The resulting collection is expected to be ordered, with the results in document order.The resulting collection may be modified, but such modification is not thread safe
- Returns:
- a collection of list(s), with each list containing the items for a given model instance
-
getModelItemsByName
Get the collection of model items associated with the instance having the providedname.The resulting collection may be modified, but such modification is not thread safe
- Parameters:
name- the instance name to get model items for- Returns:
- the sequence of items associated with the named model instance, or an empty list if an instance with that name is not present
-
modelItems
Get the model items (i.e., fields, assemblies) and value data associated this node as a stream.- Returns:
- the stream of model items or an empty stream if none exist
-
getLocation
Get the resource location information for the node, if known.- Returns:
- the resource location information, or
nullif not known
-
stringValue
Get the string value of the node.- Returns:
- the string value of the node or an empty string if it has no value.
-
getStaticContext
Get the static context to use to query this node item.- Returns:
- the static context
-
accept
Description copied from interface:IItemA visitor callback used to visit a variety of Metapath item types.
-