Search in sources :

Example 1 with CsvFieldWriter

use of io.atlasmap.csv.core.CsvFieldWriter in project atlasmap by atlasmap.

the class CsvModule method writeTargetValue.

@Override
public void writeTargetValue(AtlasInternalSession session) throws AtlasException {
    CsvFieldWriter writer = session.getFieldWriter(getDocId(), CsvFieldWriter.class);
    writer.write(session);
}
Also used : CsvFieldWriter(io.atlasmap.csv.core.CsvFieldWriter)

Example 2 with CsvFieldWriter

use of io.atlasmap.csv.core.CsvFieldWriter in project atlasmap by atlasmap.

the class CsvModule method processPostTargetExecution.

@Override
public void processPostTargetExecution(AtlasInternalSession session) throws AtlasException {
    CsvFieldWriter writer = session.getFieldWriter(getDocId(), CsvFieldWriter.class);
    if (writer != null && writer.getDocument() != null) {
        String targetDocumentString = writer.toCsv();
        session.setTargetDocument(getDocId(), targetDocumentString);
    } else {
        AtlasUtil.addAudit(session, getDocId(), String.format("No target document created for DataSource:[id=%s, uri=%s]", getDocId(), this.getUri()), AuditStatus.WARN, null);
    }
    session.removeFieldWriter(getDocId());
    if (LOG.isDebugEnabled()) {
        LOG.debug("{}: processPostTargetExecution completed", getDocId());
    }
}
Also used : CsvFieldWriter(io.atlasmap.csv.core.CsvFieldWriter)

Example 3 with CsvFieldWriter

use of io.atlasmap.csv.core.CsvFieldWriter in project atlasmap by atlasmap.

the class CsvModule method processPreTargetExecution.

@Override
public void processPreTargetExecution(AtlasInternalSession session) throws AtlasException {
    CsvConfig csvConfig = CsvConfig.newConfig(getUriParameters());
    CsvFieldWriter writer = new CsvFieldWriter(csvConfig);
    session.setFieldWriter(getDocId(), writer);
    if (LOG.isDebugEnabled()) {
        LOG.debug("{}: processPreTargetExcution completed", getDocId());
    }
}
Also used : CsvFieldWriter(io.atlasmap.csv.core.CsvFieldWriter) CsvConfig(io.atlasmap.csv.core.CsvConfig)

Aggregations

CsvFieldWriter (io.atlasmap.csv.core.CsvFieldWriter)3 CsvConfig (io.atlasmap.csv.core.CsvConfig)1