public class CsvServiceImpl extends Object implements CsvService
Modifier and Type | Field and Description |
---|---|
static String[] |
HEADERS |
static String |
HEADERS_STRING |
Constructor and Description |
---|
CsvServiceImpl(RuleValidator ruleValidator) |
Modifier and Type | Method and Description |
---|---|
String |
createCSV(List<Rule> rules)
Creates a CSV string from the given rules.
|
CsvImportResult |
parseCSV(Group group,
InputStream inputStream,
boolean hasHeader)
Parses the given CSV stream into rules.
|
public static final String[] HEADERS
public static final String HEADERS_STRING
public CsvServiceImpl(RuleValidator ruleValidator)
public CsvImportResult parseCSV(Group group, InputStream inputStream, boolean hasHeader) throws CSVImportException
CsvService
parseCSV
in interface CsvService
inputStream
- The inputstream to read the CSV from.hasHeader
- If defined, the csv defined by the inputStream has an header, and this is skipped (not considered as a Rule).CSVImportException
- is thrown when parsing the CSV fails.public String createCSV(List<Rule> rules)
CsvService
createCSV
in interface CsvService
Copyright © 2021. All rights reserved.