Package com.poiji.bind
Class Poiji
java.lang.Object
com.poiji.bind.Poiji
The entry point of the mapping process.
Example:
List employees = Poiji.fromExcel(new File("employees.xls"), Employee.class); employees.size(); // 3 Employee firstEmployee = employees.get(0); // Employee{employeeId=123923, name='Joe', surname='Doe', age=30, single=true, birthday='4/9/1987'}
Created by hakan on 16/01/2017.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
converts excel rows into a list of objectsstatic <T> List<T>
fromExcel
(File file, Class<T> type, PoijiOptions options) converts excel rows into a list of objectsstatic <T> void
fromExcel
(File file, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objectsstatic <T> void
converts excel rows into a list of objectsstatic <T> List<T>
fromExcel
(InputStream inputStream, PoijiExcelType excelType, Class<T> type) converts excel rows into a list of objectsstatic <T> List<T>
fromExcel
(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options) converts excel rows into a list of objectsstatic <T> void
fromExcel
(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objectsstatic <T> void
fromExcel
(InputStream inputStream, PoijiExcelType excelType, Class<T> type, Consumer<? super T> consumer) converts excel rows into a list of objectsstatic <T> List<T>
converts excel rows into a list of objectsstatic <T> List<T>
fromExcel
(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type, PoijiOptions options) converts excel rows into a list of objectsstatic <T> void
fromExcel
(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objectsstatic <T> T
fromExcelProperties
(File file, Class<T> type) converts excel properties into an objectstatic <T> T
fromExcelProperties
(File file, Class<T> type, PoijiOptions options) converts excel properties into an objectstatic <T> T
fromExcelProperties
(InputStream inputStream, PoijiExcelType excelType, Class<T> type) converts excel properties into an objectstatic <T> T
fromExcelProperties
(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options) converts excel properties into an object
-
Method Details
-
fromExcelProperties
converts excel properties into an object- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xlsx.type
- type of the root object.- Returns:
- the newly created objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcelProperties
public static <T> T fromExcelProperties(InputStream inputStream, PoijiExcelType excelType, Class<T> type) converts excel properties into an object- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xlsx only!type
- type of the root object.- Returns:
- the newly created object
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcelProperties
converts excel properties into an object- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xlsx.type
- type of the root object.options
- specifies to change the default behaviour of the poiji. In this case, only the password has an effect- Returns:
- the newly created object
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcelProperties
public static <T> T fromExcelProperties(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options) converts excel properties into an object- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xlsx only!type
- type of the root object.options
- specifies to change the default behaviour of the poiji. In this case, only the password has an effect- Returns:
- the newly created object
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xls or .xlsx.type
- type of the root object.- Returns:
- the newly created list of objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xls or .xlsx.type
- type of the root object.consumer
- output retrieves records- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> List<T> fromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xls or xlsxtype
- type of the root object.- Returns:
- the newly created list of objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> void fromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type, Consumer<? super T> consumer) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xls or xlsxtype
- type of the root object.consumer
- represents an operation that accepts the type argument- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xls or .xlsx.type
- type of the root object.options
- specifies to change the default behaviour of the poiji.- Returns:
- the newly created list of objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> void fromExcel(File file, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
file
- excel file ending with .xls or .xlsx.type
- type of the root object.options
- specifies to change the default behaviour of the poiji.consumer
- represents an operation that accepts the type argument- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> List<T> fromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xls or xlsxtype
- type of the root object.options
- specifies to change the default behaviour of the poiji.- Returns:
- the newly created list of objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> void fromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
inputStream
- excel file streamexcelType
- type of the excel file, xls or xlsxtype
- type of the root object.options
- specifies to change the default behaviour of the poiji.consumer
- represents an operation that accepts the type argument- Throws:
PoijiException
- if an internal exception occurs during the mapping process.InvalidExcelFileExtension
- if the specified excel file extension is invalid.IllegalCastException
- if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.- See Also:
-
fromExcel
public static <T> List<T> fromExcel(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type, PoijiOptions options) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
sheet
- excel sheet its workbook must be either an instance ofHSSFWorkbook
orXSSFWorkbook
.type
- type of the root object.options
- specifies to change the default behaviour of the poiji.- Returns:
- the newly created objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.- See Also:
-
fromExcel
converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
sheet
- excel sheet its workbook must be either an instance ofHSSFWorkbook
orXSSFWorkbook
.type
- type of the root object.- Returns:
- the newly created objects
- Throws:
PoijiException
- if an internal exception occurs during the mapping process.- See Also:
-
fromExcel
public static <T> void fromExcel(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type, PoijiOptions options, Consumer<? super T> consumer) converts excel rows into a list of objects- Type Parameters:
T
- type of the root object.- Parameters:
sheet
- excel sheet its workbook must be either an instance ofHSSFWorkbook
orXSSFWorkbook
.type
- type of the root object.options
- specifies to change the default behaviour of the poiji.consumer
- represents an operation that accepts the type argument.- Throws:
PoijiException
- if an internal exception occurs during the mapping process.- See Also:
-