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 class
CWS - uniVocity writer settings class
W - uniVocity writer class
CPS - uniVocity parser settings class
P - uniVocity parser class
DF - 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 Details

    • nullValue

      protected String nullValue
    • skipEmptyLines

      protected Boolean skipEmptyLines
    • ignoreTrailingWhitespaces

      protected Boolean ignoreTrailingWhitespaces
    • ignoreLeadingWhitespaces

      protected Boolean ignoreLeadingWhitespaces
    • headersDisabled

      protected boolean headersDisabled
    • headers

      protected String headers
    • headerExtractionEnabled

      protected Boolean headerExtractionEnabled
    • numberOfRecordsToRead

      protected Integer numberOfRecordsToRead
    • emptyValue

      protected String emptyValue
    • lineSeparator

      protected String lineSeparator
    • normalizedLineSeparator

      protected Character normalizedLineSeparator
    • comment

      protected Character 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:
      marshal in interface org.apache.camel.spi.DataFormat
      Throws:
      Exception
    • unmarshal

      public Object unmarshal(org.apache.camel.Exchange exchange, InputStream stream) throws Exception
      Specified by:
      unmarshal in interface org.apache.camel.spi.DataFormat
      Throws:
      Exception
    • createWriterSettings

      protected abstract CWS createWriterSettings()
      Creates a new instance of the writer settings.
      Returns:
      New instance of the writer settings
    • configureWriterSettings

      protected void configureWriterSettings(CWS settings)
      Configures the writer settings.
      Parameters:
      settings - Writer settings to configure
    • createWriter

      protected abstract W createWriter(Writer writer, CWS settings)
      Creates a new instance of the uniVocity writer.
      Parameters:
      writer - Output writer to use
      settings - Writer settings to use
      Returns:
      New uinstance of the uniVocity writer
    • createParserSettings

      protected abstract CPS createParserSettings()
      Creates a new instance of the parser settings.
      Returns:
      New instance of the parser settings
    • configureParserSettings

      protected void configureParserSettings(CPS settings)
      Configure the parser settings.
      Parameters:
      settings - Parser settings to configure
    • createParser

      protected abstract P createParser(CPS settings)
      Creates a new instance of the uniVocity parser.
      Parameters:
      settings - Parser settings to use
      Returns:
      New instance of the uniVocity parser
    • configureFormat

      protected void configureFormat(F format)
      Configures the format.
      Parameters:
      format - format to configure
    • getNullValue

      public String getNullValue()
    • setNullValue

      public void setNullValue(String nullValue)
    • getSkipEmptyLines

      public Boolean getSkipEmptyLines()
    • setSkipEmptyLines

      public void setSkipEmptyLines(Boolean skipEmptyLines)
    • getIgnoreTrailingWhitespaces

      public Boolean getIgnoreTrailingWhitespaces()
    • setIgnoreTrailingWhitespaces

      public void setIgnoreTrailingWhitespaces(Boolean ignoreTrailingWhitespaces)
    • getIgnoreLeadingWhitespaces

      public Boolean getIgnoreLeadingWhitespaces()
    • setIgnoreLeadingWhitespaces

      public void setIgnoreLeadingWhitespaces(Boolean ignoreLeadingWhitespaces)
    • isHeadersDisabled

      public boolean isHeadersDisabled()
    • setHeadersDisabled

      public void setHeadersDisabled(boolean headersDisabled)
    • getHeaders

      public String getHeaders()
    • setHeaders

      public void setHeaders(String headers)
    • getHeaderExtractionEnabled

      public Boolean getHeaderExtractionEnabled()
    • setHeaderExtractionEnabled

      public void setHeaderExtractionEnabled(Boolean headerExtractionEnabled)
    • getNumberOfRecordsToRead

      public Integer getNumberOfRecordsToRead()
    • setNumberOfRecordsToRead

      public void setNumberOfRecordsToRead(Integer numberOfRecordsToRead)
    • getEmptyValue

      public String getEmptyValue()
    • setEmptyValue

      public void setEmptyValue(String emptyValue)
    • getLineSeparator

      public String getLineSeparator()
    • setLineSeparator

      public void setLineSeparator(String lineSeparator)
    • getNormalizedLineSeparator

      public Character getNormalizedLineSeparator()
    • setNormalizedLineSeparator

      public void setNormalizedLineSeparator(Character normalizedLineSeparator)
    • getComment

      public Character getComment()
    • setComment

      public void setComment(Character comment)
    • isLazyLoad

      public boolean isLazyLoad()
    • setLazyLoad

      public void setLazyLoad(boolean lazyLoad)
    • isAsMap

      public boolean isAsMap()
    • setAsMap

      public void setAsMap(boolean asMap)
    • getWriterSettings

      public CWS getWriterSettings()
    • setWriterSettings

      public void setWriterSettings(CWS writerSettings)
    • getMarshaller

      public org.apache.camel.dataformat.univocity.Marshaller<W> getMarshaller()
    • setMarshaller

      public void setMarshaller(org.apache.camel.dataformat.univocity.Marshaller<W> marshaller)
    • getParserSettings

      public CPS getParserSettings()
    • setParserSettings

      public void setParserSettings(CPS parserSettings)
    • getUnmarshaller

      public org.apache.camel.dataformat.univocity.Unmarshaller<P> getUnmarshaller()
    • setUnmarshaller

      public void setUnmarshaller(org.apache.camel.dataformat.univocity.Unmarshaller<P> unmarshaller)
    • getHeaderRowProcessor

      public org.apache.camel.dataformat.univocity.HeaderRowProcessor getHeaderRowProcessor()
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception