Module dev.metaschema.core
Interface INodeItemFactory
- All Known Implementing Classes:
AbstractNodeItemFactory
public interface INodeItemFactory
This factory interface is used to create
INodeItem objects of various
types.
A singleton instance of this factory can be acquired using the
instance() method.
-
Method Summary
Modifier and TypeMethodDescriptionstatic INodeItemFactoryinstance()Get the singleton instance of the default node factory.default IAssemblyNodeItemnewAssemblyNodeItem(IAssemblyDefinition definition) Create a newIAssemblyNodeItemthat is detached from a Metaschema.newAssemblyNodeItem(IAssemblyDefinition definition, IModuleNodeItem metaschema) 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(IAssemblyInstanceGrouped instance, IAssemblyNodeItem parent, int position, Object value) Create a newIAssemblyNodeItemthat is based on a Metaschema instance 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 metaschema) 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.default IFlagNodeItemnewFlagNodeItem(IFlagDefinition definition, IModuleNodeItem parent) Create a newIFlagNodeItem, with no associated value, based on the provided flag definition.default IFlagNodeItemnewFlagNodeItem(IFlagInstance instance, IModelNodeItem<?, ?> parent) Create a newIFlagNodeItembased on the provided flag instance.default IFlagNodeItemnewFlagNodeItem(IFlagInstance instance, IModelNodeItem<?, ?> parent, Object value) Create a newIFlagNodeItembased on the provided flag instance.newModuleNodeItem(IModule module) Create a new Metaschema node item for the providedmetaschema.
-
Method Details
-
instance
Get the singleton instance of the default node factory.- Returns:
- the node factory instance
-
newDocumentNodeItem
@NonNull IDocumentNodeItem newDocumentNodeItem(@NonNull IAssemblyDefinition definition, @NonNull URI documentUri, @NonNull Object value) Create a new document node item for the provideddefinition.- 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
Create a new Metaschema node item for the providedmetaschema.- Parameters:
module- the Metaschema to create the item for.- Returns:
- the new node item
-
newFlagNodeItem
@NonNull default IFlagNodeItem newFlagNodeItem(@NonNull IFlagDefinition definition, @NonNull IModuleNodeItem parent) Create a newIFlagNodeItem, with no associated value, based on the provided flag definition.- Parameters:
definition- the flag definitionparent- the item for the Metaschema containing the definition- Returns:
- the new flag node item
-
newFlagNodeItem
@NonNull default IFlagNodeItem newFlagNodeItem(@NonNull IFlagInstance instance, @NonNull IModelNodeItem<?, ?> parent) Create a newIFlagNodeItembased on the provided flag instance.- Parameters:
instance- the flag instanceparent- the node item containing the flag- Returns:
- the new flag node item
-
newFlagNodeItem
@NonNull default IFlagNodeItem newFlagNodeItem(@NonNull IFlagInstance instance, @NonNull IModelNodeItem<?, ?> parent, @NonNull Object value) Create a newIFlagNodeItembased on the provided flag instance.- Parameters:
instance- the flag instanceparent- the node item containing the flagvalue- the item's associated data- Returns:
- the new flag node item
-
newFieldNodeItem
@NonNull IFieldNodeItem newFieldNodeItem(@NonNull IFieldDefinition definition, @NonNull IModuleNodeItem metaschema) Create a newIFieldNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.- Parameters:
definition- the global definitionmetaschema- the Metaschema containing the definition- Returns:
- the new field node item
-
newFieldNodeItem
@NonNull IFieldNodeItem newFieldNodeItem(@NonNull IFieldDefinition definition, @Nullable URI baseUri) Create a newIFieldNodeItemthat is detached from a Metaschema.- Parameters:
definition- the global definitionbaseUri- the base URI to use for this node item when evaluating anIMetapathExpression- Returns:
- the new field node item
-
newFieldNodeItem
@NonNull IFieldNodeItem newFieldNodeItem(@NonNull IFieldInstance instance, @NonNull IAssemblyNodeItem parent) Create 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.
- Parameters:
instance- the Metaschema field instanceparent- the parent node item- Returns:
- the new field node item
-
newFieldNodeItem
@NonNull IFieldNodeItem newFieldNodeItem(@NonNull IFieldInstance instance, @NonNull IAssemblyNodeItem parent, int position, @NonNull Object value) Create a newIFieldNodeItemthat is based on a Metaschema instance with associated data.- 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
Create a newIAssemblyNodeItemthat is detached from a Metaschema.- Parameters:
definition- the global definition- Returns:
- the new assembly node item
-
newAssemblyNodeItem
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyDefinition definition, @NonNull IModuleNodeItem metaschema) Create a newIAssemblyNodeItembased on the provided definition, which is expected to be a global definition within the provided Metaschema.- Parameters:
definition- the global definitionmetaschema- the Metaschema containing the definition- Returns:
- the new assembly node item
-
newAssemblyNodeItem
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyDefinition definition, @Nullable URI baseUri) Create a newIAssemblyNodeItemthat is detached from a Metaschema.- Parameters:
definition- the global definitionbaseUri- the base URI to use for this node item when evaluating anIMetapathExpression- Returns:
- the new assembly node item
-
newAssemblyNodeItem
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyDefinition definition, @Nullable URI baseUri, @NonNull Object value) Create a newIAssemblyNodeItemthat is detached from a Metaschema, with associated data.- 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
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyInstance instance, @NonNull IAssemblyNodeItem parent) Create 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.
- Parameters:
instance- the Metaschema assembly instanceparent- the parent node item- Returns:
- the new assembly node item
-
newAssemblyNodeItem
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyInstanceGrouped instance, @NonNull IAssemblyNodeItem parent, int position, @NonNull Object value) Create a newIAssemblyNodeItemthat is based on a Metaschema instance with associated data.- 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
-
newAssemblyNodeItem
@NonNull IAssemblyNodeItem newAssemblyNodeItem(@NonNull IAssemblyInstance instance, @NonNull IAssemblyNodeItem parent, int position, @NonNull Object value) Create a newIAssemblyNodeItemthat is based on a Metaschema instance with associated data.- 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
-