1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.configuration.internal;
20
21 import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
22 import org.codehaus.plexus.component.configurator.converters.ConfigurationConverter;
23 import org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter;
24 import org.codehaus.plexus.component.configurator.converters.lookup.ConverterLookup;
25 import org.codehaus.plexus.component.configurator.converters.lookup.DefaultConverterLookup;
26
27 class EnhancedConverterLookup implements ConverterLookup {
28 private final ConverterLookup delegate = new DefaultConverterLookup();
29
30 EnhancedConverterLookup() {
31 registerConverter(new DefaultBeanConfigurator.PathConverter());
32 }
33
34 @Override
35 public void registerConverter(ConfigurationConverter converter) {
36 delegate.registerConverter(converter);
37 }
38
39 @Override
40 public ConfigurationConverter lookupConverterForType(Class<?> type) throws ComponentConfigurationException {
41 ConfigurationConverter converter = delegate.lookupConverterForType(type);
42 return converter.getClass().equals(ObjectWithFieldsConverter.class)
43 ? new EnhancedConfigurationConverter()
44 : converter;
45 }
46 }