Class ReadAasxFile

java.lang.Object
de.iip_ecosphere.platform.configuration.aas.ReadAasxFile

public class ReadAasxFile extends Object
Translates AASX IDTA spec files to IVML. Does not rely on AAS abstraction/Basyx as these AASX files cannot be read.
Author:
Holger Eichelberger, SSE
  • Constructor Details

    • ReadAasxFile

      public ReadAasxFile()
  • Method Details

    • getSpecNumber

      public static String getSpecNumber(File file)
      Returns the spec number of an AASX file from its file name.
      Parameters:
      file - the file
      Returns:
      the spec number, may be 0000 for unknown
    • getSpecNumber

      public static String getSpecNumber(String fileName)
      Returns the spec number of an AASX file from its file name.
      Parameters:
      fileName - the file name
      Returns:
      the spec number, may be 0000 for unknown
    • readFile

      public static void readFile(String source, String target, String specNumber) throws IOException
      Reads the given AASX file and translates it to target IVML.
      Parameters:
      source - the source file
      target - the target file
      specNumber - the specification number
      Throws:
      IOException - if reading/writing fails
    • read

      public static AasSpecSummary read(String source, String specNumber) throws IOException
      Reads the given AASX file and returns a spec summary.
      Parameters:
      source - the source file
      specNumber - the specification number
      Returns:
      the spec summary or null
      Throws:
      IOException - if reading/writing fails
    • readFile

      public static void readFile(String source, String target, String specNumber, String idShortPrefix) throws IOException
      Reads the given AASX file and translates it to target IVML.
      Parameters:
      source - the source file
      target - the target file
      specNumber - the specification number
      idShortPrefix - optional prefix for idShorts, may be null (use "name" instead)
      Throws:
      IOException - if reading/writing fails
    • iterateChilds

      private static void iterateChilds(Node node, Consumer<Node> function)
      Iterates over childs.
      Parameters:
      node - the node to iterate over
      function - the function to apply to each child
    • getIterableChildsCount

      private static int getIterableChildsCount(Node node, Predicate<Node> pred)
      Returns the number of iterable childs.
      Parameters:
      node - the node
      pred - a predicate to focus the counting, may be null for none
      Returns:
      the number of childs
      See Also:
    • getLogger

      private static de.iip_ecosphere.platform.support.logging.Logger getLogger()
      Returns the logger instance for this class.
      Returns:
      the logger instance
    • main

      public static void main(String... args) throws IOException
      Executes the AASX file reader.
      Parameters:
      args - the first contains the AASX file name, the second the output, the third the specification number, without some test files are executed, the fourth the optional idShort prefix
      Throws:
      IOException - if reading fails