All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cinchapi.concourse.importer.CsvImporter Maven / Gradle / Ivy

There is a newer version: 0.11.5
Show newest version
/*
 * Copyright (c) 2013-2018 Cinchapi Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.cinchapi.concourse.importer;

import com.cinchapi.concourse.Concourse;

/**
 * 

* An {@link Importer} that can handle generic CSV files that have header * information in the first line. It is advisable to extend this class for CSV * data that has special requirements. This class makes some general assumptions * that can be configured in a subclass: *

*

Header

*

* It is assumed that the first line of a CSV file contains the header. If that * is not the case, the subclass can return an ordered array of header keys from * the {@link #header()} method. *

*

Delimiter

*

* It is assumed that values in a line are comma separated. If that is not the * case, the subclass can specify a different rule in the {@link #delimiter()} * method. *

*

Transforming Values

*

* It is assumed that the original file data is correct. If that is not the * case, the subclass can selectively transform some values in the * {@link #transformValue(String, String)} method. For example, it might be * desirable specify link resolution, compact data or normalize data. *

* * @author Jeff Nelson */ public class CsvImporter extends DelimitedLineImporter { /** * Construct a new instance. * * @param concourse */ public CsvImporter(Concourse concourse) { super(concourse); } @Override protected char delimiter() { return ','; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy