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
  • Field Details

  • 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

      void setParent(BaSyxSubmodelElementParent parent)
      Defines the parent element.
      Parameters:
      parent - the parent
    • getParent

      public BaSyxSubmodelElementParent getParent()
      Returns the parent element.
      Returns:
      the parent element
    • setSemanticId

      public void setSemanticId(String semanticId)
      Specified by:
      setSemanticId in interface de.iip_ecosphere.platform.support.aas.HasSemantics
    • getSemanticId

      public String getSemanticId(boolean stripPrefix)
      Specified by:
      getSemanticId in interface de.iip_ecosphere.platform.support.aas.HasSemantics
    • getIdShort

      public String getIdShort()
      Specified by:
      getIdShort in interface de.iip_ecosphere.platform.support.aas.Element
    • update

      public void update()
      Specified by:
      update in interface de.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 calls function on the aggregated path.
      Parameters:
      path - the path accumulated so far
      skipIfNoRepo - skip executing function if there is no repository to pass into
      function - 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 effect
      element - the element to be added to path
      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 effect
      element - the element to be added to path
      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 Id
      path - the submodelId path
      repo - the submodel repository
      elt - 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)
      Uses processOnPath(List, boolean, PathFunction) to delete the givenelement in the submodel registry (if present). Must be called by setters.
    • updateConnectedSubmodelElement

      protected void updateConnectedSubmodelElement()
      Uses processOnPath(List, boolean, PathFunction) to update this element in the submodel registry (if present). Must be called by setters.
    • createConnectedSubmodelElement

      protected void createConnectedSubmodelElement()
      Uses processOnPath(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

      protected static <I extends BaSyxSubmodelElement> I updateInBuild(boolean isNew, I instance)
      Conditional update/create.
      Parameters:
      isNew - whether instance is created/new in builder or updating
      instance - the actual instance
      See Also: