Skip to content

Commit d140a6e

Browse files
authored
Add OrasModel for better Quarkus reflective support (#277)
2 parents 03636b1 + 265bc14 commit d140a6e

23 files changed

+165
-1
lines changed

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<wiremock.version>3.12.1</wiremock.version>
7070
<mockito.version>5.17.0</mockito.version>
7171
<system.stubs.version>2.1.8</system.stubs.version>
72+
<classgraph.version>4.8.177</classgraph.version>
7273

7374
<!-- Plugin version -->
7475
<build.helper-maven-plugin.version>3.6.0</build.helper-maven-plugin.version>
@@ -115,6 +116,11 @@
115116
<artifactId>gson</artifactId>
116117
<version>${gson.version}</version>
117118
</dependency>
119+
<dependency>
120+
<groupId>io.github.classgraph</groupId>
121+
<artifactId>classgraph</artifactId>
122+
<version>${classgraph.version}</version>
123+
</dependency>
118124
<dependency>
119125
<groupId>org.apache.commons</groupId>
120126
<artifactId>commons-compress</artifactId>
@@ -211,6 +217,11 @@
211217
<artifactId>logback-classic</artifactId>
212218
<scope>test</scope>
213219
</dependency>
220+
<dependency>
221+
<groupId>io.github.classgraph</groupId>
222+
<artifactId>classgraph</artifactId>
223+
<scope>test</scope>
224+
</dependency>
214225
<dependency>
215226
<groupId>org.junit.jupiter</groupId>
216227
<artifactId>junit-jupiter-api</artifactId>

src/main/java/land/oras/Annotations.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* @param filesAnnotations Annotations for the layers/files
3636
*/
3737
@NullMarked
38+
@OrasModel
3839
public record Annotations(
3940
Map<String, String> configAnnotations,
4041
Map<String, String> manifestAnnotations,

src/main/java/land/oras/ArtifactType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* Class for artifact type
3030
*/
3131
@NullMarked
32+
@OrasModel
3233
public class ArtifactType {
3334

3435
private final String mediaType;

src/main/java/land/oras/Config.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* Class for config
3333
*/
3434
@NullUnmarked
35+
@OrasModel
3536
public final class Config extends Descriptor {
3637

3738
/**

src/main/java/land/oras/ContainerRef.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* A referer of a container on a {@link Registry}.
3535
*/
3636
@NullMarked
37+
@OrasModel
3738
public final class ContainerRef extends Ref<ContainerRef> {
3839

3940
/**

src/main/java/land/oras/Describable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* Interface for describable objects
2525
*/
26+
@OrasModel
2627
public interface Describable {
2728

2829
/**

src/main/java/land/oras/Descriptor.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
/**
3131
* Main class for descriptor
3232
*/
33+
@OrasModel
3334
public sealed class Descriptor permits Config, Manifest, Layer, Index {
3435

3536
/**
@@ -42,15 +43,35 @@ public sealed class Descriptor permits Config, Manifest, Layer, Index {
4243
*/
4344
protected final @Nullable Map<String, String> annotations;
4445

46+
/**
47+
* The digest of the layer
48+
*/
4549
protected final @Nullable String digest;
50+
51+
/**
52+
* The size of the layer
53+
*/
4654
protected final @Nullable Long size;
55+
56+
/**
57+
* The artifact type
58+
*/
4759
protected final @Nullable String artifactType;
4860

4961
/**
5062
* Original json
5163
*/
5264
protected transient String json;
5365

66+
/**
67+
* Constructor
68+
* @param digest The digest
69+
* @param size The size
70+
* @param mediaType The media type
71+
* @param annotations The annotations
72+
* @param artifactType The artifact type
73+
* @param json The original JSON
74+
*/
5475
protected Descriptor(
5576
String digest,
5677
Long size,

src/main/java/land/oras/Index.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
/**
3333
* Index from an OCI layout
3434
*/
35+
@OrasModel
3536
public final class Index extends Descriptor implements Describable {
3637

3738
private final int schemaVersion;

src/main/java/land/oras/Layer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* Class for layer
3737
*/
3838
@NullMarked
39+
@OrasModel
3940
public final class Layer extends Descriptor {
4041

4142
/**

src/main/java/land/oras/LayoutRef.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* A referer of a container on a {@link OCILayout}.
3131
*/
3232
@NullMarked
33+
@OrasModel
3334
public final class LayoutRef extends Ref<LayoutRef> {
3435

3536
private final Path folder;

0 commit comments

Comments
 (0)