Package bld.common.spreadsheet.utils
Class SpreadsheetUtils
- java.lang.Object
-
- bld.common.spreadsheet.utils.SpreadsheetUtils
-
@Component public class SpreadsheetUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intSHEET_NAME_SIZEThe Constant SHEET_NAME_SIZE.
-
Constructor Summary
Constructors Constructor Description SpreadsheetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Annotation>
TgetAnnotation(Class<?> classExcel, Class<T> classAnnotation)Gets the annotation.static <T extends Annotation>
TgetAnnotation(Field field, Class<T> classAnnotation)Gets the annotation.static Set<Field>getListField(Class<?> classComponentExcel)Gets the list field.static Map<String,Field>getMapField(Class<?> classComponentExcel)Gets the map field.static <T,K extends Annotation>
TreflectionAnnotation(T entity, K annotation)Reflection annotation.static voidwriteToFile(String pathFile, String fileName, String typeFile, byte[] data)Write to file.
-
-
-
Field Detail
-
SHEET_NAME_SIZE
public static final int SHEET_NAME_SIZE
The Constant SHEET_NAME_SIZE.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAnnotation
public static <T extends Annotation> T getAnnotation(Class<?> classExcel, Class<T> classAnnotation)
Gets the annotation.- Type Parameters:
T- the generic type- Parameters:
classExcel- the class excelclassAnnotation- the class annotation- Returns:
- the annotation
-
getAnnotation
public static <T extends Annotation> T getAnnotation(Field field, Class<T> classAnnotation)
Gets the annotation.- Type Parameters:
T- the generic type- Parameters:
field- the fieldclassAnnotation- the class annotation- Returns:
- the annotation
-
reflectionAnnotation
public static <T,K extends Annotation> T reflectionAnnotation(T entity, K annotation)
Reflection annotation.- Type Parameters:
T- the generic typeK- the key type- Parameters:
entity- the entityannotation- the annotation- Returns:
- the t
-
getListField
public static Set<Field> getListField(Class<?> classComponentExcel)
Gets the list field.- Parameters:
classComponentExcel- the class component excel- Returns:
- the list field
-
getMapField
public static Map<String,Field> getMapField(Class<?> classComponentExcel)
Gets the map field.- Parameters:
classComponentExcel- the class component excel- Returns:
- the map field
-
-