org.apache.camel.component.lucene.LuceneComponentConfigurer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of camel-lucene Show documentation
Show all versions of camel-lucene Show documentation
Camel Lucene based search component
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.lucene;
import javax.annotation.processing.Generated;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
@SuppressWarnings("unchecked")
public class LuceneComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
private org.apache.camel.component.lucene.LuceneConfiguration getOrCreateConfig(LuceneComponent target) {
if (target.getConfig() == null) {
target.setConfig(new org.apache.camel.component.lucene.LuceneConfiguration());
}
return target.getConfig();
}
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
LuceneComponent target = (LuceneComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "analyzer": getOrCreateConfig(target).setAnalyzer(property(camelContext, org.apache.lucene.analysis.Analyzer.class, value)); return true;
case "autowiredenabled":
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
case "config": target.setConfig(property(camelContext, org.apache.camel.component.lucene.LuceneConfiguration.class, value)); return true;
case "indexdir":
case "indexDir": getOrCreateConfig(target).setIndexDir(property(camelContext, java.io.File.class, value)); return true;
case "lazystartproducer":
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "maxhits":
case "maxHits": getOrCreateConfig(target).setMaxHits(property(camelContext, int.class, value)); return true;
case "srcdir":
case "srcDir": getOrCreateConfig(target).setSrcDir(property(camelContext, java.io.File.class, value)); return true;
default: return false;
}
}
@Override
public Class> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "analyzer": return org.apache.lucene.analysis.Analyzer.class;
case "autowiredenabled":
case "autowiredEnabled": return boolean.class;
case "config": return org.apache.camel.component.lucene.LuceneConfiguration.class;
case "indexdir":
case "indexDir": return java.io.File.class;
case "lazystartproducer":
case "lazyStartProducer": return boolean.class;
case "maxhits":
case "maxHits": return int.class;
case "srcdir":
case "srcDir": return java.io.File.class;
default: return null;
}
}
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
LuceneComponent target = (LuceneComponent) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "analyzer": return getOrCreateConfig(target).getAnalyzer();
case "autowiredenabled":
case "autowiredEnabled": return target.isAutowiredEnabled();
case "config": return target.getConfig();
case "indexdir":
case "indexDir": return getOrCreateConfig(target).getIndexDir();
case "lazystartproducer":
case "lazyStartProducer": return target.isLazyStartProducer();
case "maxhits":
case "maxHits": return getOrCreateConfig(target).getMaxHits();
case "srcdir":
case "srcDir": return getOrCreateConfig(target).getSrcDir();
default: return null;
}
}
}