Skip to content

Commit

Permalink
Merge 0bc7b4b into 12283d9
Browse files Browse the repository at this point in the history
  • Loading branch information
vaa25 committed Feb 8, 2020
2 parents 12283d9 + 0bc7b4b commit bd4cc44
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions src/main/java/com/poiji/bind/Poiji.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.poiji.option.PoijiOptions;
import com.poiji.option.PoijiOptions.PoijiOptionsBuilder;
import com.poiji.util.Files;

import java.io.File;
import java.io.InputStream;
import java.util.ArrayList;
Expand Down Expand Up @@ -61,7 +60,7 @@ private Poiji() {
*
* @see Poiji#fromExcel(File, Class, PoijiOptions)
*/
public static synchronized <T> List<T> fromExcel(final File file, final Class<T> type) {
public static <T> List<T> fromExcel(final File file, final Class<T> type) {
final ArrayList<T> list = new ArrayList<>();
fromExcel(file, type, list::add);
return list;
Expand All @@ -82,7 +81,7 @@ public static synchronized <T> List<T> fromExcel(final File file, final Class<T>
*
* @see Poiji#fromExcel(File, Class, PoijiOptions)
*/
public static synchronized <T> void fromExcel(final File file, final Class<T> type, final Consumer<? super T> consumer) {
public static <T> void fromExcel(final File file, final Class<T> type, final Consumer<? super T> consumer) {
final Unmarshaller unmarshaller = deserializer(file, PoijiOptionsBuilder.settings().build());
unmarshaller.unmarshal(type, consumer);
}
Expand All @@ -100,9 +99,9 @@ public static synchronized <T> void fromExcel(final File file, final Class<T> ty
* @throws IllegalCastException if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class, PoijiOptions)
*/
public static synchronized <T> List<T> fromExcel(final InputStream inputStream,
PoijiExcelType excelType,
final Class<T> type) {
public static <T> List<T> fromExcel(
final InputStream inputStream, PoijiExcelType excelType, final Class<T> type
) {
final ArrayList<T> list = new ArrayList<>();
fromExcel(inputStream, excelType, type, list::add);
return list;
Expand All @@ -121,10 +120,9 @@ public static synchronized <T> List<T> fromExcel(final InputStream inputStream,
* @throws IllegalCastException if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class, PoijiOptions)
*/
public static synchronized <T> void fromExcel(final InputStream inputStream,
PoijiExcelType excelType,
final Class<T> type,
final Consumer<? super T> consumer) {
public static <T> void fromExcel(
final InputStream inputStream, PoijiExcelType excelType, final Class<T> type, final Consumer<? super T> consumer
) {
Objects.requireNonNull(excelType);

final Unmarshaller unmarshaller = deserializer(inputStream, excelType, PoijiOptionsBuilder.settings().build());
Expand All @@ -144,9 +142,9 @@ public static synchronized <T> void fromExcel(final InputStream inputStream,
* @throws IllegalCastException if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class)
*/
public static synchronized <T> List<T> fromExcel(final File file, final Class<T> type, final PoijiOptions options) {
public static <T> List<T> fromExcel(final File file, final Class<T> type, final PoijiOptions options) {
final ArrayList<T> list = new ArrayList<>();
fromExcel(file, type, options,list::add);
fromExcel(file, type, options, list::add);
return list;
}

Expand All @@ -163,7 +161,9 @@ public static synchronized <T> List<T> fromExcel(final File file, final Class<T>
* @throws IllegalCastException if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class)
*/
public static synchronized <T> void fromExcel(final File file, final Class<T> type, final PoijiOptions options, final Consumer<? super T> consumer) {
public static <T> void fromExcel(
final File file, final Class<T> type, final PoijiOptions options, final Consumer<? super T> consumer
) {
final Unmarshaller unmarshaller = deserializer(file, options);
unmarshaller.unmarshal(type, consumer);
}
Expand All @@ -182,13 +182,12 @@ public static synchronized <T> void fromExcel(final File file, final Class<T> ty
* @throws IllegalCastException if this Field object is enforcing Java language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class)
*/
public static synchronized <T> List<T> fromExcel(final InputStream inputStream,
final PoijiExcelType excelType,
final Class<T> type,
final PoijiOptions options) {
public static <T> List<T> fromExcel(
final InputStream inputStream, final PoijiExcelType excelType, final Class<T> type, final PoijiOptions options
) {
Objects.requireNonNull(excelType);
final ArrayList<T> list = new ArrayList<>();
fromExcel(inputStream, excelType,type, options, list::add);
fromExcel(inputStream, excelType, type, options, list::add);
return list;
}

Expand All @@ -207,11 +206,10 @@ public static synchronized <T> List<T> fromExcel(final InputStream inputStream,
* language access control and the underlying field is either inaccessible or final.
* @see Poiji#fromExcel(File, Class)
*/
public static synchronized <T> void fromExcel(final InputStream inputStream,
final PoijiExcelType excelType,
final Class<T> type,
final PoijiOptions options,
final Consumer<? super T> consumer) {
public static <T> void fromExcel(
final InputStream inputStream, final PoijiExcelType excelType, final Class<T> type, final PoijiOptions options,
final Consumer<? super T> consumer
) {
Objects.requireNonNull(excelType);

final Unmarshaller unmarshaller = deserializer(inputStream, excelType, options);
Expand Down

0 comments on commit bd4cc44

Please sign in to comment.