Package bld.common.spreadsheet.utils
Class SpreadsheetUtils
- java.lang.Object
-
- bld.common.spreadsheet.utils.SpreadsheetUtils
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@Component public class SpreadsheetUtils extends Object implements org.springframework.context.ApplicationContextAware
-
-
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 Instance 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 org.springframework.context.ApplicationContextgetApplicationContext()Gets the application context.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.voidsetApplicationContext(org.springframework.context.ApplicationContext ac)Sets the application context.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
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext ac) throws org.springframework.beans.BeansExceptionSets the application context.- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
ac- the new application context- Throws:
org.springframework.beans.BeansException- the beans exception
-
getApplicationContext
public static org.springframework.context.ApplicationContext getApplicationContext()
Gets the application context.- Returns:
- the application context
-
-