Examples of parseLine()


Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

            escapeChar = firstCharOrDefault(config.get("escape_char"), CSVParser.DEFAULT_ESCAPE_CHARACTER);
            strictQuotes = Objects.firstNonNull((Boolean) config.get("strict_quotes"), false);
            trimLeadingWhiteSpace = Objects.firstNonNull((Boolean) config.get("trim_leading_whitespace"), true);

            final CSVParser parser = getCsvParser();
            fieldNames = parser.parseLine(columnHeader);
            if (fieldNames.length == 0) {
                throw new ConfigurationException("No field names found.");
            }
        } catch (Exception e) {
            throw new ConfigurationException("Invalid configuration for CsvConverter");
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

            return value;
        }
        final CSVParser parser = getCsvParser();
        final Map<String, String> fields = Maps.newHashMap();
        try {
            final String[] strings = parser.parseLine(value);
            if (strings.length != fieldNames.length) {
                LOG.error("Different number of columns in CSV data ({}) and configured field names ({}). Discarding input.",
                          strings.length, fieldNames.length);
                return null;
            }
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

    }

    private String[] parseLine() {
        try {
            final CSVParser parser = _dataSet.getCsvParser();
            return parser.parseLine(_line);
        } catch (IOException e) {
            if (_failOnInconsistentRowLength) {
                throw new MetaModelException("Failed to parse CSV line no. " + _rowNumber + ": " + _line, e);
            } else {
                logger.warn("Encountered unparseable line no. {}, returning line as a single value with trailing nulls: {}", _rowNumber, _line);
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

            final String[] line = iterator.next();
            // the array with player's playerRecord
            String[] playerRecord;
            try {
                // parse player's record and fill it into an array
                playerRecord = parser.parseLine(line[0]);
            } catch (final IOException ioe) {
                throw new ImportException(ResourceLoader.getMessage(MessageId.E002.getMessageKey()), ioe);
            }

            // if first part is numeric it is actually a player
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

            final String[] line = iterator.next();
            // the array with player's history
            String[] playerHistory;
            try {
                // parse player's history and fill it into an array
                playerHistory = parser.parseLine(line[0]);
            } catch (final IOException ioe) {
                throw new ImportException(ResourceLoader.getMessage(MessageId.E002.getMessageKey()), ioe);
            }

            // if first part is numeric it is actually a player's history
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

                    parser = s_commaParser;
                }
            }
           
            try {
                return parser.parseLine(s);
            } catch (IOException e) {
                return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " error: " + e.getMessage());
            }
        }
        return new EvalError(ControlFunctionRegistry.getFunctionName(this) + " expects 1 or 2 strings");
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

                h = false;
              }

              // data
              else {
                final String[] diskData = p.parseLine(line);

                final int length = diskData.length;
                if (length <= 1) {
                  break;
                }
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

              line = line.trim();

              // first row
              if (h) {
                headers = Arrays.asList(p.parseLine(line));
                h = false;
              }

              // data
              else {
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

    private String[] getValuesInternal() {
        if (_values == null) {
            final CSVParser parser = _dataSet.getCsvParser();
            final String[] csvValues;
            try {
                csvValues = parser.parseLine(_line);
            } catch (IOException e) {
                throw new MetaModelException("Failed to parse CSV line no. " + _rowNumber + ": " + _line);
            }

            if (_failOnInconsistentRowLength) {
View Full Code Here

Examples of au.com.bytecode.opencsv.CSVParser.parseLine()

    //step 2) parse the value

    CSVParser regexParser = new CSVParser('/', (char)0x0, '\\');

    String[] parsedRegex = regexParser.parseLine(valueStr);

    //DEBUG
    if (_DEBUG) System.out.println("pKV4: parsed regex = " + Arrays.toString(parsedRegex));
   
    //0 is "" or s
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.