@Component public class ExcelUtils extends Object implements org.springframework.context.ApplicationContextAware
| Modifier and Type | Field and Description |
|---|---|
static String |
ANNOTATION_DATA
The Constant ANNOTATION_DATA.
|
static String |
ANNOTATIONS
The Constant ANNOTATIONS.
|
static short |
AUTO_SIZE_HEIGHT
The Constant AUTO_SIZE_HEIGHT.
|
static String |
ENV_SHEET_NAME
The Constant ENV_SHEET_NAME.
|
| Constructor and Description |
|---|
ExcelUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addAnnotation(Class<?> classe,
Class<? extends Annotation> classAnnotation,
Annotation annotation)
Adds the annotation.
|
static String |
coordinateCalculation(int row,
int idColumn,
boolean isBlockColumn,
boolean isBlockRow)
Calcolo coordinate function.
|
static Double |
evaluate(String exprenssionIndex,
String param,
Number value)
Evaluate.
|
static <T extends Annotation> |
getAnnotation(Class<?> classExcel,
Class<T> classAnnotation)
Gets the annotation.
|
static <T extends Annotation> |
getAnnotation(Field field,
Class<T> classAnnotation)
Gets the annotation.
|
static org.springframework.context.ApplicationContext |
getApplicationContext()
Gets the application context.
|
static String |
getKeyColumn(org.apache.poi.ss.usermodel.Sheet sheet,
String key)
Gets the key column.
|
static Set<Field> |
getListField(Class<?> classComponentExcel)
Gets the list field.
|
static Map<String,Field> |
getMapField(Class<?> classComponentExcel)
Gets the map field.
|
static String |
getNameParameter(String parameter)
Gets the name parameter.
|
static <T> Class<T> |
getTClass(Object entity)
Gets the t class.
|
static <T> Class<T> |
getTClass(Object entity,
int i)
Gets the t class.
|
static Matcher |
matcher(String param,
String function)
Matcher.
|
static <T,K extends Annotation> |
reflectionAnnotation(T entity,
K annotation)
Reflection annotation.
|
static short |
rowHeight(int rowHeight)
Hight row.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext ac)
Sets the application context.
|
static short |
widthColumn(int widthColumn)
Width column.
|
static void |
writeToFile(String pathFile,
String fileName,
String typeFile,
byte[] dati)
Write to file.
|
public static final String ANNOTATIONS
public static final String ANNOTATION_DATA
public static final short AUTO_SIZE_HEIGHT
public static final String ENV_SHEET_NAME
public static <T extends Annotation> T getAnnotation(Class<?> classExcel, Class<T> classAnnotation) throws Exception
T - the generic typeclassExcel - the class excelclassAnnotation - the class annotationException - the exceptionpublic static <T extends Annotation> T getAnnotation(Field field, Class<T> classAnnotation) throws Exception
T - the generic typefield - the fieldclassAnnotation - the class annotationException - the exceptionpublic static <T,K extends Annotation> T reflectionAnnotation(T entity, K annotation)
T - the generic typeK - the key typeentity - the entityannotation - the annotationpublic static void addAnnotation(Class<?> classe, Class<? extends Annotation> classAnnotation, Annotation annotation) throws Exception
classe - the classeclassAnnotation - the class annotationannotation - the annotationException - the exceptionpublic void setApplicationContext(org.springframework.context.ApplicationContext ac)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareac - the new application contextorg.springframework.beans.BeansException - the beans exceptionpublic static org.springframework.context.ApplicationContext getApplicationContext()
public static String getNameParameter(String parameter)
parameter - the parameterpublic static void writeToFile(String pathFile, String fileName, String typeFile, byte[] dati)
pathFile - the path filefileName - the file nametypeFile - the type filedati - the datipublic static String coordinateCalculation(int row, int idColumn, boolean isBlockColumn, boolean isBlockRow)
row - the rowidColumn - the id columnisBlockColumn - the is block columnisBlockRow - the is block rowpublic static String getKeyColumn(org.apache.poi.ss.usermodel.Sheet sheet, String key)
sheet - the sheetkey - the keypublic static Set<Field> getListField(Class<?> classComponentExcel)
classComponentExcel - the class component excelpublic static Map<String,Field> getMapField(Class<?> classComponentExcel)
classComponentExcel - the class component excelpublic static short widthColumn(int widthColumn)
widthColumn - the width columnpublic static short rowHeight(int rowHeight)
rowHeight - the hight rowpublic static <T> Class<T> getTClass(Object entity)
T - the generic typeentity - the entitypublic static <T> Class<T> getTClass(Object entity, int i)
T - the generic typeentity - the entityi - the ipublic static Double evaluate(String exprenssionIndex, String param, Number value)
exprenssionIndex - the exprenssion indexparam - the paramvalue - the valueCopyright © 2022. All rights reserved.