Class IdShortPathBuilder

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.basyx.IdShortPathBuilder

public class IdShortPathBuilder extends Object
Builder class for building IdShortPath from a list of SubmodelElement.

Some examples of valid list of SubmodelElement

 [SMC, SML, SMC, Property]
 [SMC]
 [File]
 [SML, SML, MultiLanguageProperty]
 [SMC, SMC, SML]
 
Author:
danish
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    IdShortPathBuilder(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> idShortPathElements)
    Creates a builder instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    appendNonSMLIdShortPath(boolean isFirstElement, StringBuilder idShortPathBuilder, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement parentSME)
    Appends a non-SML id short path.
    private void
    appendSMLIdShortPath(boolean isFirstElement, boolean previousOccurrenceSubmodelElementList, StringBuilder idShortPathBuilder, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement parentSME, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement childSME)
    Appends a non-SML id short path.
    Builds the IdShortPath.
    private void
    validateIdShortPathElements(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> idShortPathElements)
    Validates the given elements.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • idShortPathElements

      private List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> idShortPathElements
  • Constructor Details

    • IdShortPathBuilder

      public IdShortPathBuilder(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> idShortPathElements)
      Creates a builder instance.
      Parameters:
      idShortPathElements - the ids of the submodel elements to use
  • Method Details

    • build

      public String build()
      Builds the IdShortPath.
      Returns:
      the idShortPath
    • appendNonSMLIdShortPath

      private void appendNonSMLIdShortPath(boolean isFirstElement, StringBuilder idShortPathBuilder, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement parentSME)
      Appends a non-SML id short path.
      Parameters:
      isFirstElement - is this the first element
      idShortPathBuilder - the string builder for the path
      parentSME - the parent SME
    • appendSMLIdShortPath

      private void appendSMLIdShortPath(boolean isFirstElement, boolean previousOccurrenceSubmodelElementList, StringBuilder idShortPathBuilder, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement parentSME, org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement childSME)
      Appends a non-SML id short path.
      Parameters:
      isFirstElement - is this the first element
      previousOccurrenceSubmodelElementList - whether the previous occurence is a SML
      idShortPathBuilder - the string builder for the path
      parentSME - the parent SME
      childSME - the child SME to process
    • validateIdShortPathElements

      private void validateIdShortPathElements(List<org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement> idShortPathElements)
      Validates the given elements.
      Parameters:
      idShortPathElements - the id short of the given elements