Class AbstractUniVocityDataFormat<F extends com.univocity.parsers.common.Format,CWS extends com.univocity.parsers.common.CommonWriterSettings<F>,W extends com.univocity.parsers.common.AbstractWriter<CWS>,CPS extends com.univocity.parsers.common.CommonParserSettings<F>,P extends com.univocity.parsers.common.AbstractParser<CPS>,DF extends AbstractUniVocityDataFormat<F,CWS,W,CPS,P,DF>>
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.dataformat.univocity.AbstractUniVocityDataFormat<F,CWS,W,CPS,P,DF>
- Type Parameters:
F- uniVocity format classCWS- uniVocity writer settings classW- uniVocity writer classCPS- uniVocity parser settings classP- uniVocity parser classDF- the data format class (for providing a fluent API)
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.DataFormat,org.apache.camel.spi.DataFormatName,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
- Direct Known Subclasses:
UniVocityCsvDataFormat,UniVocityFixedDataFormat,UniVocityTsvDataFormat
public abstract class AbstractUniVocityDataFormat<F extends com.univocity.parsers.common.Format,CWS extends com.univocity.parsers.common.CommonWriterSettings<F>,W extends com.univocity.parsers.common.AbstractWriter<CWS>,CPS extends com.univocity.parsers.common.CommonParserSettings<F>,P extends com.univocity.parsers.common.AbstractParser<CPS>,DF extends AbstractUniVocityDataFormat<F,CWS,W,CPS,P,DF>>
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.DataFormat, org.apache.camel.spi.DataFormatName
This abstract class contains all the common parts for all the uniVocity parsers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Characterprotected Stringprotected Booleanprotected Stringprotected booleanprotected Booleanprotected Booleanprotected booleanprotected Stringprotected Characterprotected Stringprotected Integerprotected BooleanFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureFormat(F format) Configures the format.protected voidconfigureParserSettings(CPS settings) Configure the parser settings.protected voidconfigureWriterSettings(CWS settings) Configures the writer settings.protected abstract PcreateParser(CPS settings) Creates a new instance of the uniVocity parser.protected abstract CPSCreates a new instance of the parser settings.protected abstract WcreateWriter(Writer writer, CWS settings) Creates a new instance of the uniVocity writer.protected abstract CWSCreates a new instance of the writer settings.protected voiddoStart()protected voiddoStop()org.apache.camel.dataformat.univocity.HeaderRowProcessororg.apache.camel.dataformat.univocity.Marshaller<W> org.apache.camel.dataformat.univocity.Unmarshaller<P> booleanisAsMap()booleanbooleanvoidmarshal(org.apache.camel.Exchange exchange, Object body, OutputStream stream) voidsetAsMap(boolean asMap) voidsetComment(Character comment) voidsetEmptyValue(String emptyValue) voidsetHeaderExtractionEnabled(Boolean headerExtractionEnabled) voidsetHeaders(String headers) voidsetHeadersDisabled(boolean headersDisabled) voidsetIgnoreLeadingWhitespaces(Boolean ignoreLeadingWhitespaces) voidsetIgnoreTrailingWhitespaces(Boolean ignoreTrailingWhitespaces) voidsetLazyLoad(boolean lazyLoad) voidsetLineSeparator(String lineSeparator) voidsetMarshaller(org.apache.camel.dataformat.univocity.Marshaller<W> marshaller) voidsetNormalizedLineSeparator(Character normalizedLineSeparator) voidsetNullValue(String nullValue) voidsetNumberOfRecordsToRead(Integer numberOfRecordsToRead) voidsetParserSettings(CPS parserSettings) voidsetSkipEmptyLines(Boolean skipEmptyLines) voidsetUnmarshaller(org.apache.camel.dataformat.univocity.Unmarshaller<P> unmarshaller) voidsetWriterSettings(CWS writerSettings) unmarshal(org.apache.camel.Exchange exchange, InputStream stream) Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, 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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.spi.DataFormat
unmarshalMethods inherited from interface org.apache.camel.spi.DataFormatName
getDataFormatNameMethods 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
-
Field Details
-
nullValue
-
skipEmptyLines
-
ignoreTrailingWhitespaces
-
ignoreLeadingWhitespaces
-
headersDisabled
protected boolean headersDisabled -
headers
-
headerExtractionEnabled
-
numberOfRecordsToRead
-
emptyValue
-
lineSeparator
-
normalizedLineSeparator
-
comment
-
lazyLoad
protected boolean lazyLoad -
asMap
protected boolean asMap
-
-
Constructor Details
-
AbstractUniVocityDataFormat
public AbstractUniVocityDataFormat()
-
-
Method Details
-
marshal
public void marshal(org.apache.camel.Exchange exchange, Object body, OutputStream stream) throws Exception - Specified by:
marshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
unmarshal
- Specified by:
unmarshalin interfaceorg.apache.camel.spi.DataFormat- Throws:
Exception
-
createWriterSettings
Creates a new instance of the writer settings.- Returns:
- New instance of the writer settings
-
configureWriterSettings
Configures the writer settings.- Parameters:
settings- Writer settings to configure
-
createWriter
Creates a new instance of the uniVocity writer.- Parameters:
writer- Output writer to usesettings- Writer settings to use- Returns:
- New uinstance of the uniVocity writer
-
createParserSettings
Creates a new instance of the parser settings.- Returns:
- New instance of the parser settings
-
configureParserSettings
Configure the parser settings.- Parameters:
settings- Parser settings to configure
-
createParser
Creates a new instance of the uniVocity parser.- Parameters:
settings- Parser settings to use- Returns:
- New instance of the uniVocity parser
-
configureFormat
Configures the format.- Parameters:
format- format to configure
-
getNullValue
-
setNullValue
-
getSkipEmptyLines
-
setSkipEmptyLines
-
getIgnoreTrailingWhitespaces
-
setIgnoreTrailingWhitespaces
-
getIgnoreLeadingWhitespaces
-
setIgnoreLeadingWhitespaces
-
isHeadersDisabled
public boolean isHeadersDisabled() -
setHeadersDisabled
public void setHeadersDisabled(boolean headersDisabled) -
getHeaders
-
setHeaders
-
getHeaderExtractionEnabled
-
setHeaderExtractionEnabled
-
getNumberOfRecordsToRead
-
setNumberOfRecordsToRead
-
getEmptyValue
-
setEmptyValue
-
getLineSeparator
-
setLineSeparator
-
getNormalizedLineSeparator
-
setNormalizedLineSeparator
-
getComment
-
setComment
-
isLazyLoad
public boolean isLazyLoad() -
setLazyLoad
public void setLazyLoad(boolean lazyLoad) -
isAsMap
public boolean isAsMap() -
setAsMap
public void setAsMap(boolean asMap) -
getWriterSettings
-
setWriterSettings
-
getMarshaller
-
setMarshaller
-
getParserSettings
-
setParserSettings
-
getUnmarshaller
-
setUnmarshaller
-
getHeaderRowProcessor
public org.apache.camel.dataformat.univocity.HeaderRowProcessor getHeaderRowProcessor() -
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-