Module dev.metaschema.core
Class AbstractNodeItemFactory
java.lang.Object
dev.metaschema.core.metapath.item.node.AbstractNodeItemFactory
- All Implemented Interfaces:
INodeItemFactory,INodeItemGenerator
public abstract class AbstractNodeItemFactory
extends Object
implements INodeItemFactory, INodeItemGenerator
A base implementation of a node item factory that creates node items for
Metaschema definitions and instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stream<? extends INamedModelInstance>getNamedModelInstances(IContainerModelAbsolute container) Get the descendant model instances of the providedcontainer.protected Stream<? extends IModelInstance>getValuedModelInstances(IContainerModelAbsolute container) Get the descendant model instances of the providedcontainer.newAssemblyNodeItem(IAssemblyDefinition definition, IModuleNodeItem module) Create a newIAssemblyNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.newAssemblyNodeItem(IAssemblyDefinition definition, URI baseUri) Create a newIAssemblyNodeItemthat is detached from a Metaschema.newAssemblyNodeItem(IAssemblyDefinition definition, URI baseUri, Object value) Create a newIAssemblyNodeItemthat is detached from a Metaschema, with associated data.newAssemblyNodeItem(IAssemblyInstance instance, IAssemblyNodeItem parent) Create a newIAssemblyNodeItemthat is based on a Metaschema instance.newAssemblyNodeItem(IAssemblyInstance instance, IAssemblyNodeItem parent, int position, Object value) Create a newIAssemblyNodeItemthat is based on a Metaschema instance with associated data.newDocumentNodeItem(IAssemblyDefinition definition, URI documentUri, Object value) Create a new document node item for the provideddefinition.newFieldNodeItem(IFieldDefinition definition, IModuleNodeItem module) Create a newIFieldNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.newFieldNodeItem(IFieldDefinition definition, URI baseUri) Create a newIFieldNodeItemthat is detached from a Metaschema.newFieldNodeItem(IFieldInstance instance, IAssemblyNodeItem parent) Create a newIFieldNodeItemthat is based on a Metaschema instance.newFieldNodeItem(IFieldInstance instance, IAssemblyNodeItem parent, int position, Object value) Create a newIFieldNodeItemthat is based on a Metaschema instance with associated data.protected IModelNodeItem<?,?> newModelItem(INamedModelInstance instance, IAssemblyNodeItem parent) protected IModelNodeItem<?,?> newModelItem(INamedModelInstance instance, IAssemblyNodeItem parent, int position, Object value) newModuleNodeItem(IModule module) Create a new Metaschema node item for the providedmetaschema.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.metapath.item.node.INodeItemFactory
newAssemblyNodeItem, newAssemblyNodeItem, newFlagNodeItem, newFlagNodeItem, newFlagNodeItemMethods inherited from interface dev.metaschema.core.metapath.item.node.INodeItemGenerator
newDataModelSupplier, newDataModelSupplier, newDataModelSupplier, newMetaschemaModelSupplier, newMetaschemaModelSupplier, newMetaschemaModelSupplier
-
Constructor Details
-
AbstractNodeItemFactory
public AbstractNodeItemFactory()
-
-
Method Details
-
newDocumentNodeItem
public IDocumentNodeItem newDocumentNodeItem(IAssemblyDefinition definition, URI documentUri, Object value) Description copied from interface:INodeItemFactoryCreate a new document node item for the provideddefinition.- Specified by:
newDocumentNodeItemin interfaceINodeItemFactory- Parameters:
definition- the root assembly definition to create the document item for.documentUri- the uniform resource identifier of the documentvalue- the root item's associated data- Returns:
- the new node item
-
newModuleNodeItem
Description copied from interface:INodeItemFactoryCreate a new Metaschema node item for the providedmetaschema.- Specified by:
newModuleNodeItemin interfaceINodeItemFactory- Parameters:
module- the Metaschema to create the item for.- Returns:
- the new node item
-
newFieldNodeItem
Description copied from interface:INodeItemFactoryCreate a newIFieldNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.- Specified by:
newFieldNodeItemin interfaceINodeItemFactory- Parameters:
definition- the global definitionmodule- the Metaschema containing the definition- Returns:
- the new field node item
-
newFieldNodeItem
Description copied from interface:INodeItemFactoryCreate a newIFieldNodeItemthat is detached from a Metaschema.- Specified by:
newFieldNodeItemin interfaceINodeItemFactory- Parameters:
definition- the global definitionbaseUri- the base URI to use for this node item when evaluating anIMetapathExpression- Returns:
- the new field node item
-
newFieldNodeItem
Description copied from interface:INodeItemFactoryCreate a newIFieldNodeItemthat is based on a Metaschema instance.A single instance of this item is expected to represent the possibility in a metaschema of a series of instance values.
- Specified by:
newFieldNodeItemin interfaceINodeItemFactory- Parameters:
instance- the Metaschema field instanceparent- the parent node item- Returns:
- the new field node item
-
newFieldNodeItem
public IFieldNodeItem newFieldNodeItem(IFieldInstance instance, IAssemblyNodeItem parent, int position, Object value) Description copied from interface:INodeItemFactoryCreate a newIFieldNodeItemthat is based on a Metaschema instance with associated data.- Specified by:
newFieldNodeItemin interfaceINodeItemFactory- Parameters:
instance- the Metaschema field instanceparent- the parent node itemposition- the data item's position in the sequence of data items for the instancevalue- the item's associated data- Returns:
- the new field node item
-
newAssemblyNodeItem
public IAssemblyNodeItem newAssemblyNodeItem(IAssemblyDefinition definition, IModuleNodeItem module) Description copied from interface:INodeItemFactoryCreate a newIAssemblyNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.- Specified by:
newAssemblyNodeItemin interfaceINodeItemFactory- Parameters:
definition- the global definitionmodule- the Metaschema containing the definition- Returns:
- the new assembly node item
-
newAssemblyNodeItem
Description copied from interface:INodeItemFactoryCreate a newIAssemblyNodeItemthat is detached from a Metaschema.- Specified by:
newAssemblyNodeItemin interfaceINodeItemFactory- Parameters:
definition- the global definitionbaseUri- the base URI to use for this node item when evaluating anIMetapathExpression- Returns:
- the new assembly node item
-
newAssemblyNodeItem
public IAssemblyNodeItem newAssemblyNodeItem(IAssemblyDefinition definition, URI baseUri, Object value) Description copied from interface:INodeItemFactoryCreate a newIAssemblyNodeItemthat is detached from a Metaschema, with associated data.- Specified by:
newAssemblyNodeItemin interfaceINodeItemFactory- Parameters:
definition- the global definitionbaseUri- the base URI to use for this node item when evaluating anIMetapathExpressionvalue- the associated data- Returns:
- the new assembly node item
-
newAssemblyNodeItem
Description copied from interface:INodeItemFactoryCreate a newIAssemblyNodeItemthat is based on a Metaschema instance.A single instance of this item is expected to represent the possibility in a metaschema of a series of instance values.
- Specified by:
newAssemblyNodeItemin interfaceINodeItemFactory- Parameters:
instance- the Metaschema assembly instanceparent- the parent node item- Returns:
- the new assembly node item
-
newAssemblyNodeItem
public IAssemblyNodeItem newAssemblyNodeItem(IAssemblyInstance instance, IAssemblyNodeItem parent, int position, Object value) Description copied from interface:INodeItemFactoryCreate a newIAssemblyNodeItemthat is based on a Metaschema instance with associated data.- Specified by:
newAssemblyNodeItemin interfaceINodeItemFactory- Parameters:
instance- the Metaschema assembly instanceparent- the parent node itemposition- the data item's position in the sequence of data items for the instance, which is0basedvalue- the data item's value- Returns:
- the new assembly node item
-
newModelItem
@NonNull protected IModelNodeItem<?,?> newModelItem(@NonNull INamedModelInstance instance, @NonNull IAssemblyNodeItem parent, int position, @NonNull Object value) Create a newIModelNodeItembased on the providedinstancethat is a child of the providedparent. This new item will have the providedvalue.- Parameters:
instance- the model instance to create the node forparent- the item to use as the parent item for the created node itemposition- the data item's position in the sequence of data items for the instance, which is0basedvalue- the data item's value- Returns:
- the created node item
-
newModelItem
@NonNull protected IModelNodeItem<?,?> newModelItem(@NonNull INamedModelInstance instance, @NonNull IAssemblyNodeItem parent) Create a newIModelNodeItembased on the providedinstancethat is a child of the providedparent. This new item will have no associated value.- Parameters:
instance- the model instance to create the node forparent- the item to use as the parent item for the created node item- Returns:
- the created node item
-
getNamedModelInstances
@NonNull protected Stream<? extends INamedModelInstance> getNamedModelInstances(@NonNull IContainerModelAbsolute container) Get the descendant model instances of the providedcontainer.- Parameters:
container- the container to get descendant instances for- Returns:
- the stream of descendant instances
-
getValuedModelInstances
@NonNull protected Stream<? extends IModelInstance> getValuedModelInstances(@NonNull IContainerModelAbsolute container) Get the descendant model instances of the providedcontainer.- Parameters:
container- the container to get descendant instances for- Returns:
- the stream of descendant instances
-