Package com.poiji.bind
Class Poiji
- java.lang.Object
-
- com.poiji.bind.Poiji
-
public final class Poiji extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>fromExcel(File file, Class<T> type)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> voidfromExcel(File file, Class<T> type, PoijiOptions options, Consumer<? super T> consumer)converts excel rows into a list of objectsstatic <T> voidfromExcel(File file, Class<T> type, Consumer<? super T> consumer)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> voidfromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options, Consumer<? super T> consumer)converts excel rows into a list of objectsstatic <T> voidfromExcel(InputStream inputStream, PoijiExcelType excelType, Class<T> type, Consumer<? super T> consumer)converts excel rows into a list of objectsstatic <T> List<T>fromExcel(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type)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> voidfromExcel(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> TfromExcelProperties(File file, Class<T> type)converts excel properties into an objectstatic <T> TfromExcelProperties(File file, Class<T> type, PoijiOptions options)converts excel properties into an objectstatic <T> TfromExcelProperties(InputStream inputStream, PoijiExcelType excelType, Class<T> type)converts excel properties into an objectstatic <T> TfromExcelProperties(InputStream inputStream, PoijiExcelType excelType, Class<T> type, PoijiOptions options)converts excel properties into an object
-
-
-
Method Detail
-
fromExcelProperties
public static <T> T fromExcelProperties(File file, Class<T> type)
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(File, Class, PoijiOptions)
-
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(InputStream, PoijiExcelType, Class, PoijiOptions)
-
fromExcelProperties
public static <T> T fromExcelProperties(File file, Class<T> type, PoijiOptions options)
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(File, Class)
-
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:
fromExcelProperties(InputStream, PoijiExcelType, Class)
-
fromExcel
public static <T> List<T> fromExcel(File file, Class<T> type)
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(File, Class, PoijiOptions)
-
fromExcel
public static <T> void fromExcel(File file, Class<T> type, 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.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(File, Class, PoijiOptions)
-
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(InputStream, PoijiExcelType, Class, PoijiOptions)
-
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(File, Class, PoijiOptions)
-
fromExcel
public static <T> List<T> fromExcel(File file, Class<T> type, PoijiOptions options)
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(File, Class)
-
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(File, Class)
-
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(InputStream, PoijiExcelType, Class)
-
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(File, Class)
-
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 ofHSSFWorkbookorXSSFWorkbook.type- type of the root object.options- specifies to change the default behaviour of the poiji.- Throws:
PoijiException- if an internal exception occurs during the mapping process.- See Also:
fromExcel(Sheet, Class, PoijiOptions, Consumer),fromExcel(Sheet, Class)
-
fromExcel
public static <T> List<T> fromExcel(org.apache.poi.ss.usermodel.Sheet sheet, Class<T> type)
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 ofHSSFWorkbookorXSSFWorkbook.type- type of the root object.- Throws:
PoijiException- if an internal exception occurs during the mapping process.- See Also:
fromExcel(Sheet, Class, PoijiOptions),fromExcel(Sheet, Class, PoijiOptions, Consumer)
-
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 ofHSSFWorkbookorXSSFWorkbook.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:
fromExcel(Sheet, Class, PoijiOptions),fromExcel(Sheet, Class)
-
-