001/* Generated by org.apache.camel:apt */
002package org.apache.camel.component.event;
003
004import java.util.HashMap;
005import java.util.Map;
006
007import org.apache.camel.CamelContext;
008import org.apache.camel.spi.GeneratedPropertyConfigurer;
009import org.apache.camel.support.component.PropertyConfigurerSupport;
010
011/**
012 * Source code generated by org.apache.camel:apt
013 */
014@SuppressWarnings("unchecked")
015public class EventEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
016
017    @Override
018    public boolean configure(CamelContext camelContext, Object endpoint, String name, Object value, boolean ignoreCase) {
019        if (ignoreCase) {
020            return doConfigureIgnoreCase(camelContext, endpoint, name, value);
021        } else {
022            return doConfigure(camelContext, endpoint, name, value);
023        }
024    }
025
026    private static boolean doConfigure(CamelContext camelContext, Object endpoint, String name, Object value) {
027        switch (name) {
028        case "lazyStartProducer": ((EventEndpoint) endpoint).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
029        case "bridgeErrorHandler": ((EventEndpoint) endpoint).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
030        case "exceptionHandler": ((EventEndpoint) endpoint).setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
031        case "exchangePattern": ((EventEndpoint) endpoint).setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
032        case "synchronous": ((EventEndpoint) endpoint).setSynchronous(property(camelContext, boolean.class, value)); return true;
033        case "basicPropertyBinding": ((EventEndpoint) endpoint).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
034            default: return false;
035        }
036    }
037
038    private static boolean doConfigureIgnoreCase(CamelContext camelContext, Object endpoint, String name, Object value) {
039        switch (name.toLowerCase()) {
040        case "lazystartproducer": ((EventEndpoint) endpoint).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
041        case "bridgeerrorhandler": ((EventEndpoint) endpoint).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
042        case "exceptionhandler": ((EventEndpoint) endpoint).setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
043        case "exchangepattern": ((EventEndpoint) endpoint).setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
044        case "synchronous": ((EventEndpoint) endpoint).setSynchronous(property(camelContext, boolean.class, value)); return true;
045        case "basicpropertybinding": ((EventEndpoint) endpoint).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
046            default: return false;
047        }
048    }
049
050}
051