package io.georocket.index.xml;

import io.georocket.index.generic.BoundingBoxIndexerFactory;

/**
 * Create instances of {@link BoundingBoxIndexer}
 * @author Michel Kraemer
 */
public class XMLBoundingBoxIndexerFactory extends BoundingBoxIndexerFactory implements XMLIndexerFactory {
  @Override
  public XMLIndexer createIndexer() {
    return new BoundingBoxIndexer();
  }
}

@@ -26,16 +26,102 @@
 x.xml;%0A%0A
+import java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.util.Properties;%0A%0A
 import i
@@ -333,16 +333,20 @@
 rFactory
+%0A   
  impleme
@@ -375,92 +375,1411 @@
 %7B%0A  
-@Override%0A  public XMLIndexer createIndexer() %7B%0A    return new BoundingBoxIndexer();
+private static final String PROPERTIES_FILENAME =%0A    %22io.georocket.index.xml.XMLBoundingBoxIndexerFactory.properties%22;%0A  private static final String BOUNDINGBOXINDEXER_CLASSNAME =%0A    %22io.georocket.index.xml.BoundingBoxIndexer%22;%0A  private static Class%3C? extends BoundingBoxIndexer%3E configuredClass;%0A%0A  static %7B%0A    loadConfig();%0A  %7D%0A%0A  @SuppressWarnings(%22unchecked%22)%0A  private static void loadConfig() %7B%0A    try (InputStream is = XMLBoundingBoxIndexerFactory.class.getClassLoader()%0A        .getResourceAsStream(PROPERTIES_FILENAME)) %7B%0A      if (is != null) %7B%0A        Properties p = new Properties();%0A        p.load(is);%0A        String cls = p.getProperty(BOUNDINGBOXINDEXER_CLASSNAME);%0A        if (cls != null) %7B%0A          try %7B%0A            configuredClass = (Class%3C? extends BoundingBoxIndexer%3E)Class.forName(cls);%0A          %7D catch (ClassNotFoundException e) %7B%0A            throw new RuntimeException(%22Could not find custom %22%0A              + %22BoundingBoxIndexer class: %22 + cls, e);%0A          %7D%0A        %7D%0A      %7D%0A    %7D catch (IOException e) %7B%0A      // ignore%0A    %7D%0A  %7D%0A%0A  @Override%0A  public XMLIndexer createIndexer() %7B%0A    if (configuredClass == null) %7B%0A      return new BoundingBoxIndexer();%0A    %7D%0A    try %7B%0A      return configuredClass.newInstance();%0A    %7D catch (ReflectiveOperationException e) %7B%0A      throw new RuntimeException(%22Could not create custom %22%0A        + %22BoundingBoxIndexer%22, e);%0A    %7D
 %0A  %7D

Add possibility to override the default BoundingBoxIndexer