Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Commit 6778a5d

Browse files
committed
- updated to latest version of XML and JSON de-/serializer
- using maven properties to manage dependency versions across subproject
1 parent 57cf81a commit 6778a5d

59 files changed

Lines changed: 6448 additions & 6186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dataformat-json/pom.xml

Lines changed: 62 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,12 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
6-
76
<parent>
87
<groupId>io.adminshell.aas</groupId>
98
<artifactId>dataformat-parent</artifactId>
109
<version>${revision}</version>
1110
</parent>
1211
<artifactId>dataformat-json</artifactId>
13-
14-
<build>
15-
<plugins>
16-
<plugin>
17-
<groupId>org.apache.maven.plugins</groupId>
18-
<artifactId>maven-compiler-plugin</artifactId>
19-
<configuration>
20-
<source>11</source>
21-
<target>11</target>
22-
</configuration>
23-
</plugin>
24-
<plugin>
25-
<groupId>org.codehaus.mojo</groupId>
26-
<artifactId>flatten-maven-plugin</artifactId>
27-
<version>1.2.2</version>
28-
<configuration>
29-
<updatePomFile>true</updatePomFile>
30-
</configuration>
31-
<executions>
32-
<execution>
33-
<id>flatten</id>
34-
<phase>process-resources</phase>
35-
<goals>
36-
<goal>flatten</goal>
37-
</goals>
38-
</execution>
39-
<execution>
40-
<id>flatten.clean</id>
41-
<phase>clean</phase>
42-
<goals>
43-
<goal>clean</goal>
44-
</goals>
45-
</execution>
46-
</executions>
47-
</plugin>
48-
</plugins>
49-
</build>
50-
5112
<dependencies>
5213
<dependency>
5314
<groupId>io.adminshell.aas</groupId>
@@ -58,76 +19,105 @@
5819
<dependency>
5920
<groupId>javax.validation</groupId>
6021
<artifactId>validation-api</artifactId>
61-
<version>2.0.1.Final</version>
22+
<version>${javax-validation.version}</version>
6223
<scope>compile</scope>
6324
</dependency>
6425
<dependency>
6526
<groupId>com.fasterxml.jackson.core</groupId>
6627
<artifactId>jackson-annotations</artifactId>
67-
<version>2.12.1</version>
28+
<version>${jackson.version}</version>
6829
<scope>compile</scope>
6930
</dependency>
70-
71-
<dependency>
72-
<groupId>junit</groupId>
73-
<artifactId>junit</artifactId>
74-
<version>4.13</version>
75-
<scope>test</scope>
76-
</dependency>
77-
<dependency>
78-
<groupId>org.skyscreamer</groupId>
79-
<artifactId>jsonassert</artifactId>
80-
<version>1.5.0</version>
81-
<scope>test</scope>
82-
</dependency>
8331
<dependency>
8432
<groupId>com.fasterxml.jackson.core</groupId>
8533
<artifactId>jackson-databind</artifactId>
86-
<version>2.12.1</version>
34+
<version>${jackson.version}</version>
8735
</dependency>
88-
8936
<dependency>
9037
<groupId>org.slf4j</groupId>
9138
<artifactId>slf4j-api</artifactId>
92-
<version>1.7.30</version>
39+
<version>${slf4j.version}</version>
9340
</dependency>
9441
<dependency>
9542
<groupId>org.slf4j</groupId>
9643
<artifactId>slf4j-simple</artifactId>
97-
<version>1.7.30</version>
44+
<version>${slf4j.version}</version>
9845
</dependency>
99-
10046
<dependency>
10147
<groupId>com.networknt</groupId>
10248
<artifactId>json-schema-validator</artifactId>
103-
<version>1.0.52</version>
104-
</dependency>
105-
106-
<dependency>
107-
<groupId>pl.pragmatists</groupId>
108-
<artifactId>JUnitParams</artifactId>
109-
<version>1.1.1</version>
110-
<scope>test</scope>
49+
<version>${json-schema-validator.version}</version>
11150
</dependency>
11251
<dependency>
11352
<groupId>io.github.classgraph</groupId>
11453
<artifactId>classgraph</artifactId>
115-
<version>4.8.106</version>
54+
<version>${classgraph.version}</version>
11655
</dependency>
11756
<dependency>
11857
<groupId>org.hibernate.validator</groupId>
11958
<artifactId>hibernate-validator</artifactId>
120-
<version>7.0.1.Final</version>
59+
<version>${hibernate.version}</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>junit</groupId>
63+
<artifactId>junit</artifactId>
64+
<version>${junit.version}</version>
65+
<scope>test</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>pl.pragmatists</groupId>
69+
<artifactId>JUnitParams</artifactId>
70+
<version>${junit-params.version}</version>
71+
<scope>test</scope>
72+
</dependency>
73+
<dependency>
74+
<groupId>org.skyscreamer</groupId>
75+
<artifactId>jsonassert</artifactId>
76+
<version>${jsonassert.version}</version>
77+
<scope>test</scope>
12178
</dependency>
12279
</dependencies>
123-
80+
<build>
81+
<plugins>
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-compiler-plugin</artifactId>
85+
<configuration>
86+
<source>11</source>
87+
<target>11</target>
88+
</configuration>
89+
</plugin>
90+
<plugin>
91+
<groupId>org.codehaus.mojo</groupId>
92+
<artifactId>flatten-maven-plugin</artifactId>
93+
<version>1.2.2</version>
94+
<configuration>
95+
<updatePomFile>true</updatePomFile>
96+
</configuration>
97+
<executions>
98+
<execution>
99+
<id>flatten</id>
100+
<phase>process-resources</phase>
101+
<goals>
102+
<goal>flatten</goal>
103+
</goals>
104+
</execution>
105+
<execution>
106+
<id>flatten.clean</id>
107+
<phase>clean</phase>
108+
<goals>
109+
<goal>clean</goal>
110+
</goals>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
</plugins>
115+
</build>
124116
<repositories>
125117
<repository>
126118
<id>eis-public-repo</id>
127119
<name>maven-public</name>
128120
<url>https://maven.iais.fraunhofer.de/artifactory/eis-ids-public</url>
129121
</repository>
130122
</repositories>
131-
132-
133123
</project>

dataformat-json/src/main/java/io/adminshell/aas/v3/dataformat/json/DataSpecificationManager.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ private static Reference createGlobalIri(String iri) {
5959

6060
/**
6161
* Returns a Reference describing the data specification template
62-
* implemented by the given class. If the class is unknown, null is
63-
* returned.
62+
* implemented by the given class. If the class is unknown, an
63+
* IllegalArgumentException is thrown
6464
*
6565
* @param implementation type of the implementation class
6666
* @return a reference describing the data specification template
6767
* implemented by the given class
68+
* @throws IllegalArgumentException when implementation class is not known
6869
*/
6970
public static Reference getReference(Class<? extends DataSpecificationContent> implementation) {
7071
Reference result = getReferenceSafe(implementation);
@@ -75,7 +76,17 @@ public static Reference getReference(Class<? extends DataSpecificationContent> i
7576
return result;
7677
}
7778

78-
private static Reference getReferenceSafe(Class<? extends DataSpecificationContent> implementation) {
79+
/**
80+
* Returns a Reference describing the data specification template
81+
* implemented by the given class. If the class is unknown, null is
82+
* returned.
83+
*
84+
* @param implementation type of the implementation class
85+
* @return a reference describing the data specification template
86+
* implemented by the given class, or null if the implementation class is
87+
* unknown
88+
*/
89+
public static Reference getReferenceSafe(Class<? extends DataSpecificationContent> implementation) {
7990
Optional<Reference> exactMatch = KNOWN_IMPLEMENTATIONS.entrySet().stream()
8091
.filter(x -> Objects.equals(x.getValue(), implementation)).map(x -> x.getKey()).findFirst();
8192
if (exactMatch.isPresent()) {

0 commit comments

Comments
 (0)