Class FlatpackEndpoint
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.support.DefaultPollingEndpoint
org.apache.camel.component.flatpack.FlatpackEndpoint
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.ComponentAware,org.apache.camel.Endpoint,org.apache.camel.IsSingleton,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.HasId,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="1.4.0",
scheme="flatpack",
title="Flatpack",
syntax="flatpack:type:resourceUri",
remote=false,
category=TRANSFORMATION,
headersClass=FlatpackConstants.class)
public class FlatpackEndpoint
extends org.apache.camel.support.DefaultPollingEndpoint
Parse fixed width and delimited files using the FlatPack library.
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionFlatpackEndpoint(String endpointUri, org.apache.camel.Component component, String resourceUri) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) net.sf.flatpack.ParsercreateDelimitedParser(org.apache.camel.Exchange exchange) protected net.sf.flatpack.ParsercreateFixedParser(String resourceUri, Reader bodyReader) net.sf.flatpack.ParsercreateParser(org.apache.camel.Exchange exchange) org.apache.camel.Producercharorg.apache.camel.processor.loadbalancer.LoadBalancernet.sf.flatpack.ParserFactorychargetType()booleanbooleanbooleanbooleanisRemote()booleanvoidprocessDataSet(org.apache.camel.Exchange originalExchange, net.sf.flatpack.DataSet dataSet, int counter) voidsetAllowShortLines(boolean allowShortLines) Allows for lines to be shorter than expected and ignores the extra charactersvoidsetDelimiter(char delimiter) The default character delimiter for delimited files.voidsetIgnoreExtraColumns(boolean ignoreExtraColumns) Allows for lines to be longer than expected and ignores the extra charactersvoidsetIgnoreFirstRecord(boolean ignoreFirstRecord) Whether the first line is ignored for delimited files (for the column headers).voidsetLoadBalancer(org.apache.camel.processor.loadbalancer.LoadBalancer loadBalancer) voidsetParserFactory(net.sf.flatpack.ParserFactory parserFactory) voidsetResourceUri(String resourceUri) URL for loading the flatpack mapping file from classpath or file systemvoidsetSplitRows(boolean splitRows) Sets the Component to send each row as a separate exchange once parsedvoidsetTextQualifier(char textQualifier) The text qualifier for delimited files.voidsetType(FlatpackType type) Whether to use fixed or delimiterMethods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isSingletonProducerMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
FlatpackEndpoint
public FlatpackEndpoint() -
FlatpackEndpoint
-
-
Method Details
-
isRemote
public boolean isRemote() -
createProducer
- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Specified by:
createConsumerin interfaceorg.apache.camel.Endpoint- Overrides:
createConsumerin classorg.apache.camel.support.DefaultPollingEndpoint- Throws:
Exception
-
processDataSet
public void processDataSet(org.apache.camel.Exchange originalExchange, net.sf.flatpack.DataSet dataSet, int counter) throws Exception - Throws:
Exception
-
createParser
- Throws:
Exception
-
createFixedParser
protected net.sf.flatpack.Parser createFixedParser(String resourceUri, Reader bodyReader) throws IOException - Throws:
IOException
-
createDelimitedParser
public net.sf.flatpack.Parser createDelimitedParser(org.apache.camel.Exchange exchange) throws org.apache.camel.InvalidPayloadException, IOException - Throws:
org.apache.camel.InvalidPayloadExceptionIOException
-
getResourceUri
-
getParserFactory
public net.sf.flatpack.ParserFactory getParserFactory() -
setParserFactory
public void setParserFactory(net.sf.flatpack.ParserFactory parserFactory) -
getLoadBalancer
public org.apache.camel.processor.loadbalancer.LoadBalancer getLoadBalancer() -
setLoadBalancer
public void setLoadBalancer(org.apache.camel.processor.loadbalancer.LoadBalancer loadBalancer) -
isSplitRows
public boolean isSplitRows() -
setSplitRows
public void setSplitRows(boolean splitRows) Sets the Component to send each row as a separate exchange once parsed -
isAllowShortLines
public boolean isAllowShortLines() -
setAllowShortLines
public void setAllowShortLines(boolean allowShortLines) Allows for lines to be shorter than expected and ignores the extra characters -
setIgnoreExtraColumns
public void setIgnoreExtraColumns(boolean ignoreExtraColumns) Allows for lines to be longer than expected and ignores the extra characters -
isIgnoreExtraColumns
public boolean isIgnoreExtraColumns() -
getType
-
setType
Whether to use fixed or delimiter -
setResourceUri
URL for loading the flatpack mapping file from classpath or file system -
getDelimiter
public char getDelimiter() -
setDelimiter
public void setDelimiter(char delimiter) The default character delimiter for delimited files. -
getTextQualifier
public char getTextQualifier() -
setTextQualifier
public void setTextQualifier(char textQualifier) The text qualifier for delimited files. -
isIgnoreFirstRecord
public boolean isIgnoreFirstRecord() -
setIgnoreFirstRecord
public void setIgnoreFirstRecord(boolean ignoreFirstRecord) Whether the first line is ignored for delimited files (for the column headers).
-