Package br.com.objectos.comuns.io

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


    return openStream(contextClass, "/xls/" + filename);
  }

  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


    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

    return openStream(contextClass, "/xls/" + fileName);
  }

  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

    }
  }

  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.xlsx");
    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.xlsx");
    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(), "/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

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void parse_error() throws URISyntaxException {
    URL url = Resources.getResource(getClass(), "/xls/bad_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

    throw new UnsupportedOperationException();
  }

  @Override
  public Table<T> get() {
    ParsedLines lines = csv.getLines();

    Iterable<Wrapper> wrappers;
    wrappers = Iterables.transform(lines, new ToWrapper());

    Iterable<Wrapper> parsed;
View Full Code Here

  }

  @Override
  public Table<T> sheetNamed(String name) {
    Sheet sheet = AbstractTableParser.sheetNamed(name);
    ParsedLines lines = xls.withSheetName(name).getLines();

    Iterable<Wrapper> wrappers;
    wrappers = Iterables.transform(lines, new ToWrapper(sheet));

    Iterable<Wrapper> parsed;
View Full Code Here

TOP

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

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.