|
|
@ -41,6 +41,7 @@ import com.fasterxml.jackson.databind.introspect.Annotated;
|
|
|
|
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
|
|
|
|
import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
|
|
|
|
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
|
|
|
|
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
|
|
|
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
|
|
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
|
|
|
|
import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
|
|
|
@ -48,6 +49,7 @@ import com.fasterxml.jackson.databind.ser.PropertyWriter;
|
|
|
|
import com.fasterxml.jackson.databind.ser.SerializerFactory;
|
|
|
|
import com.fasterxml.jackson.databind.ser.SerializerFactory;
|
|
|
|
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
|
|
|
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
|
|
|
|
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
|
|
|
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
|
|
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
|
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.Log;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
@ -80,6 +82,7 @@ import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
|
|
|
|
import org.springframework.core.env.PropertySource;
|
|
|
|
import org.springframework.core.env.PropertySource;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
import org.springframework.util.ClassUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.unit.DataSize;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link Endpoint @Endpoint} to expose application properties from
|
|
|
|
* {@link Endpoint @Endpoint} to expose application properties from
|
|
|
@ -188,12 +191,12 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
|
|
|
|
builder.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
|
|
|
builder.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
|
|
|
|
builder.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
|
|
|
builder.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
|
|
|
builder.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);
|
|
|
|
builder.configure(SerializationFeature.WRITE_DURATIONS_AS_TIMESTAMPS, false);
|
|
|
|
JsonMapper.builder();
|
|
|
|
|
|
|
|
builder.configure(MapperFeature.USE_STD_BEAN_NAMING, true);
|
|
|
|
builder.configure(MapperFeature.USE_STD_BEAN_NAMING, true);
|
|
|
|
builder.serializationInclusion(Include.NON_NULL);
|
|
|
|
builder.serializationInclusion(Include.NON_NULL);
|
|
|
|
applyConfigurationPropertiesFilter(builder);
|
|
|
|
applyConfigurationPropertiesFilter(builder);
|
|
|
|
applySerializationModifier(builder);
|
|
|
|
applySerializationModifier(builder);
|
|
|
|
builder.addModule(new JavaTimeModule());
|
|
|
|
builder.addModule(new JavaTimeModule());
|
|
|
|
|
|
|
|
builder.addModule(new ConfigurationPropertiesModule());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void applyConfigurationPropertiesFilter(JsonMapper.Builder builder) {
|
|
|
|
private void applyConfigurationPropertiesFilter(JsonMapper.Builder builder) {
|
|
|
@ -474,6 +477,17 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* {@link SimpleModule} for configure the serializer.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private static final class ConfigurationPropertiesModule extends SimpleModule {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ConfigurationPropertiesModule() {
|
|
|
|
|
|
|
|
addSerializer(DataSize.class, ToStringSerializer.instance);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* {@link BeanSerializerModifier} to return only relevant configuration properties.
|
|
|
|
* {@link BeanSerializerModifier} to return only relevant configuration properties.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|