17
17
package org .springframework .nativex ;
18
18
19
19
/**
20
- * Options for Spring Native.
20
+ * AOT options for Spring Native.
21
21
*
22
22
* @author Sebastien Deleuze
23
23
* @author Andy Clement
@@ -26,22 +26,8 @@ public class AotOptions {
26
26
27
27
private String mode = Mode .NATIVE .toString ();
28
28
29
- /**
30
- * Determine if extra debug should come out related to verification of reflection requests.
31
- * Spring Native will compute configuration but a final stage verification runs before it is
32
- * written out to try and ensure what is requested will not lead to problems when the
33
- * native-image is built. This flag enables debugging of that final stage verification.
34
- */
35
29
private boolean debugVerify ;
36
30
37
- /**
38
- * Determine whether to check Spring components are suitable for inclusion in a native-image.
39
- * For a concrete example, verification currently checks whether bean factory methods are being
40
- * invoked directly in configuration classes. If they are then that must be enforced by using
41
- * CGLIB proxies. CGLIB proxies are not supported in native-image and so a verification error
42
- * will come out with a message indicating the code should switch to method parameter
43
- * injection (allowing Spring to control bean method invocation).
44
- */
45
31
private boolean verify = true ;
46
32
47
33
private boolean removeYamlSupport ;
@@ -52,63 +38,116 @@ public class AotOptions {
52
38
53
39
private boolean removeSpelSupport ;
54
40
55
-
41
+ /**
42
+ * Should be either {@code native} or {@code native-agent}
43
+ * @see #toMode()
44
+ */
56
45
public String getMode () {
57
46
return mode ;
58
47
}
59
48
49
+ /**
50
+ * @see #getMode()
51
+ */
60
52
public void setMode (String mode ) {
61
53
this .mode = mode ;
62
54
}
63
55
56
+ /**
57
+ * Determine whether to check Spring components are suitable for inclusion in a native-image.
58
+ * For a concrete example, verification currently checks whether bean factory methods are being
59
+ * invoked directly in configuration classes. If they are then that must be enforced by using
60
+ * CGLIB proxies. CGLIB proxies are not supported in native-image and so a verification error
61
+ * will come out with a message indicating the code should switch to method parameter
62
+ * injection (allowing Spring to control bean method invocation).
63
+ */
64
64
public boolean isVerify () {
65
65
return verify ;
66
66
}
67
67
68
+ /**
69
+ * @see #isVerify()
70
+ */
68
71
public void setVerify (boolean verify ) {
69
72
this .verify = verify ;
70
73
}
71
74
75
+ /**
76
+ * Removes Spring Boot Yaml support to optimize the footprint when set to {@code true}.
77
+ */
72
78
public boolean isRemoveYamlSupport () {
73
79
return removeYamlSupport ;
74
80
}
75
81
82
+ /**
83
+ * @see #isRemoveYamlSupport()
84
+ */
76
85
public void setRemoveYamlSupport (boolean removeYamlSupport ) {
77
86
this .removeYamlSupport = removeYamlSupport ;
78
87
}
79
88
89
+ /**
90
+ * Removes Spring Boot JMX support to optimize the footprint when set to {@code true}.
91
+ */
80
92
public boolean isRemoveJmxSupport () {
81
93
return removeJmxSupport ;
82
94
}
83
95
96
+ /**
97
+ * @see #isRemoveJmxSupport()
98
+ */
84
99
public void setRemoveJmxSupport (boolean removeJmxSupport ) {
85
100
this .removeJmxSupport = removeJmxSupport ;
86
101
}
87
102
103
+ /**
104
+ * Determine if extra debug should come out related to verification of reflection requests.
105
+ * Spring Native will compute configuration but a final stage verification runs before it is
106
+ * written out to try and ensure what is requested will not lead to problems when the
107
+ * native-image is built. This flag enables debugging of that final stage verification.
108
+ */
88
109
public boolean isDebugVerify () {
89
110
return debugVerify ;
90
111
}
91
112
113
+ /**
114
+ * @see #isDebugVerify()
115
+ */
92
116
public void setDebugVerify (boolean debugVerify ) {
93
117
this .debugVerify = debugVerify ;
94
118
}
95
119
120
+ /**
121
+ * Removes Spring XML support (XML converters, codecs and XML application context support) when set to {@code true}.
122
+ */
96
123
public boolean isRemoveXmlSupport () {
97
124
return removeXmlSupport ;
98
125
}
99
126
127
+ /**
128
+ * @see #isRemoveXmlSupport()
129
+ */
100
130
public void setRemoveXmlSupport (boolean removeXmlSupport ) {
101
131
this .removeXmlSupport = removeXmlSupport ;
102
132
}
103
133
134
+ /**
135
+ * Removes Spring SpEL support to optimize the footprint when set to {@code true}.
136
+ */
104
137
public boolean isRemoveSpelSupport () {
105
138
return removeSpelSupport ;
106
139
}
107
140
141
+ /**
142
+ * @see #isRemoveSpelSupport()
143
+ */
108
144
public void setRemoveSpelSupport (boolean removeSpelSupport ) {
109
145
this .removeSpelSupport = removeSpelSupport ;
110
146
}
111
147
148
+ /**
149
+ * Turn {@link #mode} to a {@link Mode}.
150
+ */
112
151
public Mode toMode () {
113
152
if (this .mode == null || this .mode .equals (Mode .NATIVE .toString ())) {
114
153
return Mode .NATIVE ;
0 commit comments