@@ -19,6 +19,7 @@ public final class ReflectiveClassBuildItem extends MultiBuildItem {
1919 private final boolean constructors ;
2020 private final boolean finalFieldsWritable ;
2121 private final boolean weak ;
22+ private final boolean serialization ;
2223
2324 public ReflectiveClassBuildItem (boolean methods , boolean fields , Class <?>... className ) {
2425 this (true , methods , fields , className );
@@ -30,6 +31,11 @@ public ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean f
3031
3132 private ReflectiveClassBuildItem (boolean constructors , boolean methods , boolean fields , boolean finalFieldsWritable ,
3233 boolean weak , Class <?>... className ) {
34+ this (constructors , methods , fields , false , false , false , className );
35+ }
36+
37+ private ReflectiveClassBuildItem (boolean constructors , boolean methods , boolean fields , boolean finalFieldsWritable ,
38+ boolean weak , boolean serialization , Class <?>... className ) {
3339 List <String > names = new ArrayList <>();
3440 for (Class <?> i : className ) {
3541 if (i == null ) {
@@ -43,6 +49,7 @@ private ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean
4349 this .constructors = constructors ;
4450 this .finalFieldsWritable = finalFieldsWritable ;
4551 this .weak = weak ;
52+ this .serialization = serialization ;
4653 }
4754
4855 public ReflectiveClassBuildItem (boolean methods , boolean fields , String ... className ) {
@@ -53,12 +60,26 @@ public ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean f
5360 this (constructors , methods , fields , false , false , className );
5461 }
5562
63+ public ReflectiveClassBuildItem (boolean constructors , boolean methods , boolean fields , boolean serialization ,
64+ String ... className ) {
65+ this (constructors , methods , fields , false , false , serialization , className );
66+ }
67+
5668 public static ReflectiveClassBuildItem weakClass (String ... className ) {
5769 return new ReflectiveClassBuildItem (true , true , true , false , true , className );
5870 }
5971
72+ public static ReflectiveClassBuildItem serializationClass (String ... className ) {
73+ return new ReflectiveClassBuildItem (false , false , false , false , false , true , className );
74+ }
75+
6076 private ReflectiveClassBuildItem (boolean constructors , boolean methods , boolean fields , boolean finalFieldsWritable ,
6177 boolean weak , String ... className ) {
78+ this (constructors , methods , fields , finalFieldsWritable , weak , false , className );
79+ }
80+
81+ private ReflectiveClassBuildItem (boolean constructors , boolean methods , boolean fields , boolean finalFieldsWritable ,
82+ boolean weak , boolean serialization , String ... className ) {
6283 for (String i : className ) {
6384 if (i == null ) {
6485 throw new NullPointerException ();
@@ -70,6 +91,7 @@ private ReflectiveClassBuildItem(boolean constructors, boolean methods, boolean
7091 this .constructors = constructors ;
7192 this .finalFieldsWritable = finalFieldsWritable ;
7293 this .weak = weak ;
94+ this .serialization = serialization ;
7395 }
7496
7597 public List <String > getClassNames () {
@@ -96,6 +118,10 @@ public boolean isWeak() {
96118 return weak ;
97119 }
98120
121+ public boolean isSerialization () {
122+ return serialization ;
123+ }
124+
99125 public static Builder builder (Class <?>... className ) {
100126 String [] classNameStrings = stream (className )
101127 .map (aClass -> {
@@ -122,6 +148,7 @@ public static class Builder {
122148 private boolean fields ;
123149 private boolean finalFieldsWritable ;
124150 private boolean weak ;
151+ private boolean serialization ;
125152
126153 private Builder () {
127154 }
@@ -156,6 +183,11 @@ public Builder weak(boolean weak) {
156183 return this ;
157184 }
158185
186+ public Builder serialization (boolean serialize ) {
187+ this .serialization = serialization ;
188+ return this ;
189+ }
190+
159191 public ReflectiveClassBuildItem build () {
160192 return new ReflectiveClassBuildItem (constructors , methods , fields , finalFieldsWritable , weak , className );
161193 }
0 commit comments