Class ReadAasxFile
java.lang.Object
de.iip_ecosphere.platform.configuration.aas.ReadAasxFile
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classRepresents an intermediary type result with additional values to be considered by the caller.private static classReads AAS xml nodes. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intgetIterableChildsCount(Node node, Predicate<Node> pred) Returns the number of iterable childs.private static de.iip_ecosphere.platform.support.logging.LoggerReturns the logger instance for this class.static StringgetSpecNumber(File file) Returns the spec number of an AASX file from its file name.static StringgetSpecNumber(String fileName) Returns the spec number of an AASX file from its file name.private static voiditerateChilds(Node node, Consumer<Node> function) Iterates over childs.static voidExecutes the AASX file reader.static AasSpecSummaryReads the given AASX file and returns a spec summary.static voidReads the given AASX file and translates it totargetIVML.static voidReads the given AASX file and translates it totargetIVML.
-
Constructor Details
-
ReadAasxFile
public ReadAasxFile()
-
-
Method Details
-
getSpecNumber
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
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
Reads the given AASX file and translates it totargetIVML.- Parameters:
source- the source filetarget- the target filespecNumber- the specification number- Throws:
IOException- if reading/writing fails
-
read
Reads the given AASX file and returns a spec summary.- Parameters:
source- the source filespecNumber- 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 totargetIVML.- Parameters:
source- the source filetarget- the target filespecNumber- the specification numberidShortPrefix- optional prefix for idShorts, may be null (use "name" instead)- Throws:
IOException- if reading/writing fails
-
iterateChilds
Iterates over childs.- Parameters:
node- the node to iterate overfunction- the function to apply to each child
-
getIterableChildsCount
Returns the number of iterable childs.- Parameters:
node- the nodepred- 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
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
-