All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.component.pdf.PdfEndpointConfigurer Maven / Gradle / Ivy

/* Generated by org.apache.camel:apt */
package org.apache.camel.component.pdf;

import java.util.HashMap;
import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.support.component.PropertyConfigurerSupport;

/**
 * Source code generated by org.apache.camel:apt
 */
@SuppressWarnings("unchecked")
public class PdfEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {

    @Override
    public boolean configure(CamelContext camelContext, Object endpoint, String name, Object value, boolean ignoreCase) {
        if (ignoreCase) {
            return doConfigureIgnoreCase(camelContext, endpoint, name, value);
        } else {
            return doConfigure(camelContext, endpoint, name, value);
        }
    }

    private static boolean doConfigure(CamelContext camelContext, Object endpoint, String name, Object value) {
        switch (name) {
        case "marginTop": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginTop(property(camelContext, int.class, value)); return true;
        case "marginBottom": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginBottom(property(camelContext, int.class, value)); return true;
        case "marginLeft": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginLeft(property(camelContext, int.class, value)); return true;
        case "marginRight": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginRight(property(camelContext, int.class, value)); return true;
        case "fontSize": ((PdfEndpoint) endpoint).getPdfConfiguration().setFontSize(property(camelContext, float.class, value)); return true;
        case "pageSize": ((PdfEndpoint) endpoint).getPdfConfiguration().setPageSize(property(camelContext, org.apache.pdfbox.pdmodel.common.PDRectangle.class, value)); return true;
        case "font": ((PdfEndpoint) endpoint).getPdfConfiguration().setFont(property(camelContext, org.apache.pdfbox.pdmodel.font.PDFont.class, value)); return true;
        case "textProcessingFactory": ((PdfEndpoint) endpoint).getPdfConfiguration().setTextProcessingFactory(property(camelContext, org.apache.camel.component.pdf.TextProcessingFactory.class, value)); return true;
        case "lazyStartProducer": ((PdfEndpoint) endpoint).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "bridgeErrorHandler": ((PdfEndpoint) endpoint).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "exceptionHandler": ((PdfEndpoint) endpoint).setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
        case "exchangePattern": ((PdfEndpoint) endpoint).setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
        case "synchronous": ((PdfEndpoint) endpoint).setSynchronous(property(camelContext, boolean.class, value)); return true;
        case "basicPropertyBinding": ((PdfEndpoint) endpoint).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
            default: return false;
        }
    }

    private static boolean doConfigureIgnoreCase(CamelContext camelContext, Object endpoint, String name, Object value) {
        switch (name.toLowerCase()) {
        case "margintop": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginTop(property(camelContext, int.class, value)); return true;
        case "marginbottom": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginBottom(property(camelContext, int.class, value)); return true;
        case "marginleft": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginLeft(property(camelContext, int.class, value)); return true;
        case "marginright": ((PdfEndpoint) endpoint).getPdfConfiguration().setMarginRight(property(camelContext, int.class, value)); return true;
        case "fontsize": ((PdfEndpoint) endpoint).getPdfConfiguration().setFontSize(property(camelContext, float.class, value)); return true;
        case "pagesize": ((PdfEndpoint) endpoint).getPdfConfiguration().setPageSize(property(camelContext, org.apache.pdfbox.pdmodel.common.PDRectangle.class, value)); return true;
        case "font": ((PdfEndpoint) endpoint).getPdfConfiguration().setFont(property(camelContext, org.apache.pdfbox.pdmodel.font.PDFont.class, value)); return true;
        case "textprocessingfactory": ((PdfEndpoint) endpoint).getPdfConfiguration().setTextProcessingFactory(property(camelContext, org.apache.camel.component.pdf.TextProcessingFactory.class, value)); return true;
        case "lazystartproducer": ((PdfEndpoint) endpoint).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
        case "bridgeerrorhandler": ((PdfEndpoint) endpoint).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "exceptionhandler": ((PdfEndpoint) endpoint).setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
        case "exchangepattern": ((PdfEndpoint) endpoint).setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
        case "synchronous": ((PdfEndpoint) endpoint).setSynchronous(property(camelContext, boolean.class, value)); return true;
        case "basicpropertybinding": ((PdfEndpoint) endpoint).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
            default: return false;
        }
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy