Class BaSyxSubmodelElement
java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.BaSyxSubmodelElement
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.Element,de.iip_ecosphere.platform.support.aas.HasDataSpecification,de.iip_ecosphere.platform.support.aas.HasKind,de.iip_ecosphere.platform.support.aas.HasSemantics,de.iip_ecosphere.platform.support.aas.Qualifiable,de.iip_ecosphere.platform.support.aas.Referable,de.iip_ecosphere.platform.support.aas.SubmodelElement
- Direct Known Subclasses:
BaSyxDataElement,BaSyxEntity,BaSyxMultiLanguageProperty,BaSyxOperation,BaSyxProperty,BaSyxReferenceElement,BaSyxRelationshipElement,BaSyxSubmodelElementCollection,BaSyxSubmodelElementList
public abstract class BaSyxSubmodelElement
extends Object
implements de.iip_ecosphere.platform.support.aas.SubmodelElement
Implements an abstract BaSyx sub-model element wrapper.
- Author:
- Holger Eichelberger, SSE
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA function to be called on an accumulated submodel element path. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> composePath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, BaSyxSubmodelElement element) Composes the input for an idShort path.(package private) static List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> composePath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement element) Composes the input for an idShort path.protected voidUsesprocessOnPath(List, boolean, PathFunction)to create a corresponding element in the submodel registry (if present).(package private) static org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementcreateSubmodelElement(String submodelId, String path, org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository repo, BaSyxSubmodelElement elt) Creates a submodel element.protected voiddeleteConnectedSubmodelElement(de.iip_ecosphere.platform.support.aas.SubmodelElement element) UsesprocessOnPath(List, boolean, PathFunction)to delete the givenelement in the submodel registry (if present).Returns the parent element.protected org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepositorygetRepo()Returns the submodel repository from the parent submodel.getSemanticId(boolean stripPrefix) (package private) abstract org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementReturns the implementing sub-model element.org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementprocessOnPath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, boolean skipIfNoRepo, BaSyxSubmodelElement.PathFunction function) Iterates up the path up to the submodel and callsfunctionon the aggregated path.(package private) voidsetParent(BaSyxSubmodelElementParent parent) Defines the parent element.voidsetSemanticId(String semanticId) voidupdate()protected voidUsesprocessOnPath(List, boolean, PathFunction)to update this element in the submodel registry (if present).protected static <I extends BaSyxSubmodelElement>
IupdateInBuild(boolean isNew, I instance) Conditional update/create.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.support.aas.Element
acceptMethods inherited from interface de.iip_ecosphere.platform.support.aas.HasSemantics
getSemanticId
-
Field Details
-
parent
-
-
Constructor Details
-
BaSyxSubmodelElement
public BaSyxSubmodelElement()
-
-
Method Details
-
getSubmodelElement
abstract org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement getSubmodelElement()Returns the implementing sub-model element.- Returns:
- the submodel element
-
setParent
Defines the parent element.- Parameters:
parent- the parent
-
getParent
Returns the parent element.- Returns:
- the parent element
-
setSemanticId
- Specified by:
setSemanticIdin interfacede.iip_ecosphere.platform.support.aas.HasSemantics
-
getSemanticId
- Specified by:
getSemanticIdin interfacede.iip_ecosphere.platform.support.aas.HasSemantics
-
getIdShort
- Specified by:
getIdShortin interfacede.iip_ecosphere.platform.support.aas.Element
-
update
public void update()- Specified by:
updatein interfacede.iip_ecosphere.platform.support.aas.Element
-
processOnPath
public org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement processOnPath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, boolean skipIfNoRepo, BaSyxSubmodelElement.PathFunction function) Iterates up the path up to the submodel and callsfunctionon the aggregated path.- Parameters:
path- the path accumulated so farskipIfNoRepo- skip executing function if there is no repository to pass intofunction- the function to call at the end of the path- Returns:
- the result of
function
-
composePath
static List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> composePath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, BaSyxSubmodelElement element) Composes the input for an idShort path.- Parameters:
path- the idShort path composed so far as list, may be null or empty, may be modified as a side effectelement- the element to be added topath- Returns:
- the composed path
-
composePath
static List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> composePath(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> path, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement element) Composes the input for an idShort path.- Parameters:
path- the idShort path composed so far as list, may be null or empty, may be modified as a side effectelement- the element to be added topath- Returns:
- the composed path
-
createSubmodelElement
static org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement createSubmodelElement(String submodelId, String path, org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository repo, BaSyxSubmodelElement elt) throws org.eclipse.digitaltwin.basyx.core.exceptions.ElementDoesNotExistException Creates a submodel element.- Parameters:
submodelId- the submodel element Idpath- the submodelId pathrepo- the submodel repositoryelt- the submodel element- Returns:
- null
- Throws:
org.eclipse.digitaltwin.basyx.core.exceptions.ElementDoesNotExistException
-
deleteConnectedSubmodelElement
protected void deleteConnectedSubmodelElement(de.iip_ecosphere.platform.support.aas.SubmodelElement element) UsesprocessOnPath(List, boolean, PathFunction)to delete the givenelement in the submodel registry (if present). Must be called by setters. -
updateConnectedSubmodelElement
protected void updateConnectedSubmodelElement()UsesprocessOnPath(List, boolean, PathFunction)to update this element in the submodel registry (if present). Must be called by setters. -
createConnectedSubmodelElement
protected void createConnectedSubmodelElement()UsesprocessOnPath(List, boolean, PathFunction)to create a corresponding element in the submodel registry (if present). -
getRepo
protected org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository getRepo()Returns the submodel repository from the parent submodel.- Returns:
- the submodel repository, may be null if there is none
-
updateInBuild
Conditional update/create.- Parameters:
isNew- whetherinstanceis created/new in builder or updatinginstance- the actual instance- See Also:
-