eg:
@ImportRuntimeHints(MyRuntimeHintsRegistrar.class)
public class MyRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
/**
* For GraalVM Native Compile
*
* @param hints
* @param classLoader
*/
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
try {
hints.reflection()
.registerType(java.text.Normalizer.class)
.registerType(java.text.Normalizer.Form.class)
.registerType(org.jasypt.salt.RandomSaltGenerator.class, MemberCategory.values())
.registerType(org.jasypt.iv.RandomIvGenerator.class, MemberCategory.values())
.registerType(org.jasypt.normalization.Normalizer.class)
.registerType(Class.forName("org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource"))
.registerType(Class.forName("org.springframework.core.env.PropertySource$StubPropertySource"))
;
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
}
标签:反射,Normalizer,registerType,Spring,jasypt,org,hints,class,Native
From: https://www.cnblogs.com/jiayuan2006/p/18224823