Enum LocalDateTimeStringConverter
- java.lang.Object
-
- java.lang.Enum<LocalDateTimeStringConverter>
-
- com.pig4cloud.plugin.excel.converters.LocalDateTimeStringConverter
-
- All Implemented Interfaces:
com.alibaba.excel.converters.Converter<java.time.LocalDateTime>,java.io.Serializable,java.lang.Comparable<LocalDateTimeStringConverter>
public enum LocalDateTimeStringConverter extends java.lang.Enum<LocalDateTimeStringConverter> implements com.alibaba.excel.converters.Converter<java.time.LocalDateTime>
LocalDateTime and string converter- Author:
- L.cm
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE实例
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringMINUS
-
Constructor Summary
Constructors Modifier Constructor Description privateLocalDateTimeStringConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.alibaba.excel.metadata.data.WriteCellData<java.lang.String>convertToExcelData(java.time.LocalDateTime value, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)java.time.LocalDateTimeconvertToJavaData(com.alibaba.excel.metadata.data.ReadCellData cellData, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)com.alibaba.excel.enums.CellDataTypeEnumsupportExcelTypeKey()java.lang.ClasssupportJavaTypeKey()private static java.lang.StringswitchDateFormat(java.lang.String dateString)switch date formatstatic LocalDateTimeStringConvertervalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static LocalDateTimeStringConverter[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INSTANCE
public static final LocalDateTimeStringConverter INSTANCE
实例
-
-
Field Detail
-
MINUS
private static final java.lang.String MINUS
- See Also:
- Constant Field Values
-
-
Method Detail
-
values
public static LocalDateTimeStringConverter[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (LocalDateTimeStringConverter c : LocalDateTimeStringConverter.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LocalDateTimeStringConverter valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
supportJavaTypeKey
public java.lang.Class supportJavaTypeKey()
- Specified by:
supportJavaTypeKeyin interfacecom.alibaba.excel.converters.Converter<java.time.LocalDateTime>
-
supportExcelTypeKey
public com.alibaba.excel.enums.CellDataTypeEnum supportExcelTypeKey()
- Specified by:
supportExcelTypeKeyin interfacecom.alibaba.excel.converters.Converter<java.time.LocalDateTime>
-
convertToJavaData
public java.time.LocalDateTime convertToJavaData(com.alibaba.excel.metadata.data.ReadCellData cellData, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration) throws java.text.ParseException- Specified by:
convertToJavaDatain interfacecom.alibaba.excel.converters.Converter<java.time.LocalDateTime>- Throws:
java.text.ParseException
-
convertToExcelData
public com.alibaba.excel.metadata.data.WriteCellData<java.lang.String> convertToExcelData(java.time.LocalDateTime value, com.alibaba.excel.metadata.property.ExcelContentProperty contentProperty, com.alibaba.excel.metadata.GlobalConfiguration globalConfiguration)- Specified by:
convertToExcelDatain interfacecom.alibaba.excel.converters.Converter<java.time.LocalDateTime>
-
switchDateFormat
private static java.lang.String switchDateFormat(java.lang.String dateString)
switch date format- Parameters:
dateString- dateString- Returns:
- pattern
-
-