Package org.apache.metamodel.excel

Examples of org.apache.metamodel.excel.ExcelDataContext


                ExcelConfiguration.DEFAULT_COLUMN_NAME_LINE);
        final boolean skipEmptyLines = getBoolean(params.getSkipEmptyLines(), true);
        final boolean skipEmptyColumns = getBoolean(params.getSkipEmptyColumns(), false);
        final ExcelConfiguration configuration = new ExcelConfiguration(columnNameLineNumber, skipEmptyLines,
                skipEmptyColumns);
        return new ExcelDataContext(resource, configuration);
    }
View Full Code Here


     * @param configuration
     *            the configuration with metadata for reading the spreadsheet
     * @return a DataContext object that matches the request
     */
    public static UpdateableDataContext createExcelDataContext(File file, ExcelConfiguration configuration) {
        return new ExcelDataContext(file, configuration);
    }
View Full Code Here

    @Test
    public void testReadDataContext() {
        assertEquals(ExcelDataContext.class, dataContext.getClass());

        ExcelDataContext excel = (ExcelDataContext) dataContext;
        Resource resource = excel.getResource();

        assertEquals(FileResource.class, resource.getClass());

        assertEquals("example.xlsx", resource.getName());

        assertEquals("[hello, world]", Arrays.toString(excel.getDefaultSchema().getTable(0).getColumnNames()));

        Assert.assertTrue(excel.getConfiguration().isSkipEmptyLines());
        Assert.assertTrue(excel.getConfiguration().isSkipEmptyColumns());
    }
View Full Code Here

     * @param configuration
     *            the configuration with metadata for reading the spreadsheet
     * @return a DataContext object that matches the request
     */
    public static UpdateableDataContext createExcelDataContext(File file, ExcelConfiguration configuration) {
        return new ExcelDataContext(file, configuration);
    }
View Full Code Here

     * @param configuration
     *            the configuration with metadata for reading the spreadsheet
     * @return a DataContext object that matches the request
     */
    public static UpdateableDataContext createExcelDataContext(File file, ExcelConfiguration configuration) {
        return new ExcelDataContext(file, configuration);
    }
View Full Code Here

TOP

Related Classes of org.apache.metamodel.excel.ExcelDataContext

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.