Examples of parseLine()


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

          if (lineMatches) {
            if (!foundHeaderLine && firstIgnoreField && (null != parser)) {
              if (ignore.charAt(0) != _quoteChar) { // if using quotes then don't pull the char
                line = line.substring(ignore.length());
              }//TESTED (["a","b","c"] and [a,b,c] vs XmlIgnoreFields: [ "a" ] and [ "\"a" ])             
              String[] fields = parser.parseLine(line);
              // Now override the manual fields:
              indexToField = Arrays.asList(fields).toArray();
             
              if ((indexToField.length > 1) || (0 != ((String)indexToField[0]).length())) {
                foundHeaderLine = true;
View Full Code Here

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

      DocumentPojo newDoc = new DocumentPojo();
      String primaryKey = null;
      if (null != parser) {
        JsonObject json = new JsonObject();
        try {
          String[] records = parser.parseLine(line);
          for (int i = 0; i < records.length; ++i) {
            String record = records[i];
            if ((record.length() > 0) && (i < indexToField.length)) {
              String fieldName = (String) indexToField[i];
              if ((null != fieldName) && (fieldName.length() > 0)) {
View Full Code Here

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

        int minEltCount = Integer.MAX_VALUE;
        int maxEltCount = -1;

        String line = null;
        while (lineCount < MAX_LINES && ((line = in.readLine()) != null)) {
          String parts[] = parser.parseLine(line);
          int numElts = parts.length;
          minEltCount = Math.min(minEltCount, numElts);
          maxEltCount = Math.max(maxEltCount, numElts);
          totalEltCount += numElts;
          observedEltCounts.add(numElts);
View Full Code Here

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

    try {
      int lineno = 0;
      String s = null;
      while ((s = in.readLine()) != null) {
        List<Schema.Type> schemaTypes = new ArrayList<Schema.Type>();
        String parts[] = parser.parseLine(s);

        for (int i = 0; i < parts.length; i++) {
          String elt = parts[i];
          if (elt.startsWith(",")) {
            elt = elt.substring(1);
View Full Code Here

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

  public void initializeFromStream(InputStream is) throws IOException {
    CSVParser parser = new CSVParser();
    BufferedReader r = new BufferedReader(new InputStreamReader(is));
    String line = r.readLine();
    while (line != null) {
      String[] fields = parser.parseLine(line);
      if (fields.length != 3) {
        s_logger.warn("Line {} not in proper format.", line);
      } else {
        String scheme = fields[0];
        String id = fields[1];
View Full Code Here

Examples of com.manning.hip.ch3.csv.CSVParser.parseLine()

  }

  public static StockPriceWritable fromLine(String line)
      throws IOException {
    CSVParser parser = new CSVParser();
    String[] parts = parser.parseLine(line);

    StockPriceWritable stock = new StockPriceWritable(
        //<co id="ch03_comment_seqfile_write3"/>
        parts[0], parts[1], Double.valueOf(parts[2]),
        Double.valueOf(parts[3]),
View Full Code Here

Examples of music.lib.MusicScore.parseLine()

        return;
      bufferedReader = new BufferedReader(new InputStreamReader(jarStream));
      String line;

      while ((line = bufferedReader.readLine()) != null)
        ms.parseLine(line);
    }
    catch (Exception e)
    {
      return;
    }
View Full Code Here

Examples of org.apache.flume.source.MultiportSyslogTCPSource.LineSplitter.parseLine()

    LineSplitter lineSplitter = new LineSplitter(maxLen);
    ParsedBuffer parsedLine = new ParsedBuffer();

    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf1, savedBuf, parsedLine));
    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf2, savedBuf, parsedLine));
    Assert.assertTrue("Completed line should be parsed",
        lineSplitter.parseLine(buf3, savedBuf, parsedLine));
View Full Code Here

Examples of org.apache.flume.source.MultiportSyslogTCPSource.LineSplitter.parseLine()

    ParsedBuffer parsedLine = new ParsedBuffer();

    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf1, savedBuf, parsedLine));
    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf2, savedBuf, parsedLine));
    Assert.assertTrue("Completed line should be parsed",
        lineSplitter.parseLine(buf3, savedBuf, parsedLine));

    // the fragmented message should now be reconstructed
    Assert.assertEquals(origMsg.trim(),
View Full Code Here

Examples of org.apache.flume.source.MultiportSyslogTCPSource.LineSplitter.parseLine()

    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf1, savedBuf, parsedLine));
    Assert.assertFalse("Incomplete line should not be parsed",
        lineSplitter.parseLine(buf2, savedBuf, parsedLine));
    Assert.assertTrue("Completed line should be parsed",
        lineSplitter.parseLine(buf3, savedBuf, parsedLine));

    // the fragmented message should now be reconstructed
    Assert.assertEquals(origMsg.trim(),
        parsedLine.buffer.getString(Charsets.UTF_8.newDecoder()));
    parsedLine.buffer.rewind();
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.