org.fugerit.java.nhg.GenerateReflectConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of native-helper-graalvm Show documentation
Show all versions of native-helper-graalvm Show documentation
Utilities for Graal VM code generation
package org.fugerit.java.nhg;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import org.fugerit.java.core.function.SafeFunction;
import org.fugerit.java.nhg.reflect.config.Entry;
import java.io.Writer;
import java.util.List;
public class GenerateReflectConfig {
private ObjectWriter writer;
public GenerateReflectConfig(ObjectWriter writer) {
this.writer = writer;
}
public GenerateReflectConfig() {
this( new ObjectMapper().setSerializationInclusion( JsonInclude.Include.NON_NULL ).writerWithDefaultPrettyPrinter() );
}
public void generate(Writer out, List reflectConfig ) {
SafeFunction.apply( () -> {
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
writer.writeValue( out, reflectConfig );
} );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy