Package br.com.objectos.comuns.io

Examples of br.com.objectos.comuns.io.ParsedLines$Builder


    }
  }

  public static List<String> linesOf(byte[] worksheet) throws IOException {
    ByteArrayInputStream inputStream = new ByteArrayInputStream(worksheet);
    ParsedLines lines = XlsFile.parse(inputStream).getLines();
    Iterable<String> strs = Iterables.transform(lines, Functions.toStringFunction());
    return ImmutableList.copyOf(strs);
  }
View Full Code Here


  @BeforeClass
  public void setUp() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/xls/sheet.xls");
    File file = new File(url.toURI());
    ParsedLines lines = XlsFile.parse(file)
        .skipFirstLines(1)
        .getLines();

    Iterable<Entity> entities = Iterables.transform(lines, new ToEntity());
    this.entities = ImmutableList.copyOf(entities);
View Full Code Here

  @BeforeClass
  public void setUp() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/xls/sheet.xls");
    File file = new File(url.toURI());
    ParsedLines parsedLines = XlsFile.parse(file)
        .skipFirstLines(1)
        .getLines();

    List<Line> lines = ImmutableList.copyOf(parsedLines);
View Full Code Here

  @BeforeClass
  public void setUp() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/csv/SEMI.TXT");
    File file = new File(url.toURI());
    ParsedLines lines = CsvFile.parse(file)
        .skipFirstLines(1)
        .onSemicolons()
        .getLines();

    Iterable<Entity> entities = Iterables.transform(lines, new ToEntity());
View Full Code Here

  @BeforeClass
  public void setUp() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/csv/COMMA.TXT");
    File file = new File(url.toURI());
    ParsedLines lines = CsvFile.parse(file)
        .skipFirstLines(1)
        .getLines();

    Iterable<Entity> entities = Iterables.transform(lines, new ToEntity());
    this.entities = ImmutableList.copyOf(entities);
View Full Code Here

    SortedMap<String, Charset> availableCharsets = Charset.availableCharsets();
    System.out.print(availableCharsets.keySet());

    InputStream inputStream = obterStream("UTF_8.TXT");

    ParsedLines arquivo = CsvFile
        .parse(inputStream)
        .onSemicolons()
        .skipFirstLines(1)
        .getLines();

    Iterator<Line> iterator = arquivo.iterator();

    assertTrue(iterator.hasNext());

    Line linha = iterator.next();
    assertEquals(linha.column(1).get(String.class), "BR MALLS PARTICIPAÇOES S.A.");
View Full Code Here

  }

  public void verifiqueCp850() {
    InputStream inputStream = obterStream("CP_850.TXT");

    ParsedLines arquivo = CsvFile
        .parse(inputStream)
        .encodedWith(Encoding.CP_850)
        .onSemicolons()
        .skipFirstLines(1)
        .getLines();

    Iterator<Line> iterator = arquivo.iterator();

    assertTrue(iterator.hasNext());

    Line linha = iterator.next();
    assertEquals(linha.column(1).get(String.class), "BR MALLS PARTICIPAÇOES S.A.");
View Full Code Here

  private List<Line> lines;

  @BeforeClass
  public void setUp() throws URISyntaxException {
    String line = ",";
    ParsedLines lines = CsvFile.parseString(line)
        .onCommas()
        .getLines();

    this.lines = ImmutableList.copyOf(lines);
  }
View Full Code Here

    this.data = data;
    this.file = file;
  }

  public Caracteristica get() {
    ParsedLines lines = file
        .onTabs()
        .notEscaped()
        .notQuoted()
        .encodedWith(Encoding.ISO_8859_1)
        .skipFirstLines(3)
View Full Code Here

  public CaracteristicaParser(CsvFile file) {
    this.file = file;
  }

  public Caracteristica get() {
    ParsedLines lines = file
        .onTabs()
        .encodedWith(Encoding.ISO_8859_1)
        .skipFirstLines(3)
        .withConverter(CaracteristicaSituacao.class, CaracteristicaSituacao.CONVERTER)
        .withConverter(LocalDate.class, new LocalDateCsvConverter("dd/MM/yyyy"))
View Full Code Here

TOP

Related Classes of br.com.objectos.comuns.io.ParsedLines$Builder

Copyright © 2018 www.massapicom. 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.