com.taleo.integration.client.customstep.csv
Class BaseCustomCsvStep
java.lang.Object
com.taleo.integration.client.step.BaseStep
com.taleo.integration.client.step.BaseCustomStep
com.taleo.integration.client.customstep.BaseCustomStep
com.taleo.integration.client.customstep.csv.BaseCustomCsvStep
- All Implemented Interfaces:
- com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step
- Direct Known Subclasses:
- AbstractSortStep, BaseCustomCsvPostStep, BaseCustomCsvPreStep, BreakStep, DeleteFileStep, LogContextStep, MoveFileStep, RemoveEmptyLinesPostStep, WriteFileStep
public abstract class BaseCustomCsvStep
- extends BaseCustomStep
Abstract custom step for all processing of CSV files.
This step takes all parameters from its base class
BaseCustomStep
and the
following additional parameters:
- csvDelimiter: Optional - The CSV delimiter. Default is a comma
(,).
- csvQuoteCharacter: Optional - The CSV quote character. Default is
a double quote (").
- csvHeaderPresent: Optional - The CSV header presence indicator.
Default is
false
.
In the case of an export, those parameters can be read from the query file
which is accessible from the custom steps. But there are cases where we need
to specify them here. For example, if the extract is done in XML and
transformed in CSV after, the query will not contain those values. If values
are specified in the query and as parameters, the parameters have precedence.
Ultimately, if they are not specified at all, the defaults apply.
In the case of an import, the load specification is not accessible from
within the custom steps. Those parameters must then be provided otherwise the
defaults will be used.
- Author:
- Romain Guay - Taleo Corporation
Fields inherited from class com.taleo.integration.client.step.BaseCustomStep |
parameters |
Fields inherited from class com.taleo.integration.client.step.BaseStep |
commType, ERROR_NULL_GLOBAL_CONFIG, ERROR_NULL_PIPELINE, ERROR_NULL_STEP_CONFIG, productCode, tempFolder, type, version |
Methods inherited from class com.taleo.integration.client.step.BaseCustomStep |
getDescription, getIdentifier, getName, getSupportedPipeline, getType, init |
Methods inherited from class com.taleo.integration.client.step.BaseStep |
getAllProcessSupportPipeline, getCurrentFile, getCurrentFile, getCurrentMessage, getPostProcessSupportPipeline, getPreProcessSupportPipeline, isOriginalFile, validateLastStepType, validateMessageType, validatePipeline |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.taleo.integration.client.step.Step |
validatePipeline |
BaseCustomCsvStep
public BaseCustomCsvStep()
- Constructor without arguments.
getCsvDelimiter
public char getCsvDelimiter()
- Returns:
setCsvDelimiter
public void setCsvDelimiter(char csvDelimiter)
- Parameters:
csvDelimiter
-
isCsvHeaderPresent
public boolean isCsvHeaderPresent()
- Returns:
setCsvHeaderPresent
public void setCsvHeaderPresent(boolean csvHeaderPresent)
- Parameters:
csvHeaderPresent
-
getCsvQuoteCharacter
public char getCsvQuoteCharacter()
- Returns:
setCsvQuoteCharacter
public void setCsvQuoteCharacter(char csvQuoteCharacter)
- Parameters:
csvQuoteCharacter
-
init
public void init(com.taleo.ws.integration.client.GlobalConfig config)
- Overrides:
init
in class BaseCustomStep
execute
public void execute(com.taleo.ws.integration.client.Pipeline pipeline)
throws com.taleo.integration.client.step.StepException
- Throws:
com.taleo.integration.client.step.StepException
getColumnIndex
protected int getColumnIndex(java.io.File file,
java.lang.String column)
throws java.io.IOException,
InvalidCSVFileFormat
- Get the index of the specified column in the file. The column may already
contain the index number or may contain the name of the column.
- Parameters:
file
- The CSV filecolumn
- The name or index (0 based) of the column
- Throws:
java.io.IOException
InvalidCSVFileFormat
getColumnName
protected java.lang.String getColumnName(java.io.File file,
java.lang.String column)
throws java.io.IOException,
InvalidCSVFileFormat
- Get the name of the specified column in the file. The column may already
contain the name of may also contain the index of the column.
- Parameters:
file
- The CSV filecolumn
- The name or index (0 based) of the column
- Throws:
java.io.IOException
InvalidCSVFileFormat