1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.bremersee.geojson.spring.boot.autoconfigure;
18
19 import org.apache.commons.logging.Log;
20 import org.apache.commons.logging.LogFactory;
21 import org.bremersee.geojson.GeoJsonGeometryFactory;
22 import org.springframework.boot.autoconfigure.AutoConfiguration;
23 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
24 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
25 import org.springframework.boot.context.event.ApplicationReadyEvent;
26 import org.springframework.context.annotation.Bean;
27 import org.springframework.context.event.EventListener;
28 import org.springframework.util.ClassUtils;
29
30
31
32
33
34
35 @ConditionalOnClass(name = {"org.bremersee.geojson.GeoJsonGeometryFactory"})
36 @AutoConfiguration
37 public class GeoJsonGeometryFactoryAutoConfiguration {
38
39 private static final Log log = LogFactory.getLog(GeoJsonGeometryFactoryAutoConfiguration.class);
40
41
42
43
44 public GeoJsonGeometryFactoryAutoConfiguration() {
45 super();
46 }
47
48
49
50
51 @EventListener(ApplicationReadyEvent.class)
52 public void init() {
53 log.info(String.format("""
54
55 *********************************************************************************
56 * %s
57 *********************************************************************************""",
58 ClassUtils.getUserClass(getClass()).getSimpleName()));
59 }
60
61
62
63
64
65
66 @ConditionalOnMissingBean
67 @Bean
68 public GeoJsonGeometryFactory geoJsonGeometryFactory() {
69 return new GeoJsonGeometryFactory();
70 }
71
72 }