Class ConvertObjectsToCSV
- java.lang.Object
-
- de.hybris.platform.acceleratorservices.dataexport.generic.output.csv.ConvertObjectsToCSV
-
- All Implemented Interfaces:
Converter<java.util.List<java.lang.Object>,java.lang.String>,org.springframework.core.convert.converter.Converter<java.util.List<java.lang.Object>,java.lang.String>
public class ConvertObjectsToCSV extends java.lang.Object implements Converter<java.util.List<java.lang.Object>,java.lang.String>
Class that converts a list of objects to a list of Strings using the Object's annotations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConvertObjectsToCSV.ClassAnnotationProperties
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGETTERstatic intINDEX_THREEstatic intINDEX_TWOstatic java.lang.StringISstatic java.lang.StringSETTER
-
Constructor Summary
Constructors Constructor Description ConvertObjectsToCSV()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConvertObjectsToCSV.ClassAnnotationPropertiesbuildClassProperties(java.lang.Object data)Method that gathers information about the data class and places the information into a ClassAnnotationProperties object.java.lang.Stringconvert(java.util.List<java.lang.Object> dataList)Converts the source object, creating a new instance of the destination typejava.lang.Stringconvert(java.util.List<java.lang.Object> dataList, java.lang.String prototype)Convert the source object by filling the prototypeprotected java.util.List<java.lang.String>generateData(java.util.List<java.lang.Object> dataList, ConvertObjectsToCSV.ClassAnnotationProperties classProperties)protected java.lang.StringgenerateHeader(ConvertObjectsToCSV.ClassAnnotationProperties dataProperties)protected java.lang.StringworkoutPropertyName(java.lang.String methodName)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convertAll, convertAllIgnoreExceptions, getLogger
-
-
-
-
Field Detail
-
GETTER
public static final java.lang.String GETTER
- See Also:
- Constant Field Values
-
SETTER
public static final java.lang.String SETTER
- See Also:
- Constant Field Values
-
IS
public static final java.lang.String IS
- See Also:
- Constant Field Values
-
INDEX_THREE
public static final int INDEX_THREE
- See Also:
- Constant Field Values
-
INDEX_TWO
public static final int INDEX_TWO
- See Also:
- Constant Field Values
-
-
Method Detail
-
convert
public java.lang.String convert(java.util.List<java.lang.Object> dataList, java.lang.String prototype) throws ConversionExceptionDescription copied from interface:ConverterConvert the source object by filling the prototype- Specified by:
convertin interfaceConverter<java.util.List<java.lang.Object>,java.lang.String>- Parameters:
dataList- the source objectprototype- the prototype to fill- Returns:
- the converted object, identical to the prototype
- Throws:
ConversionException- if an error occurs
-
convert
public java.lang.String convert(java.util.List<java.lang.Object> dataList)
Description copied from interface:ConverterConverts the source object, creating a new instance of the destination type- Specified by:
convertin interfaceConverter<java.util.List<java.lang.Object>,java.lang.String>- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<java.util.List<java.lang.Object>,java.lang.String>- Parameters:
dataList- the source object- Returns:
- the converted object
-
generateData
protected java.util.List<java.lang.String> generateData(java.util.List<java.lang.Object> dataList, ConvertObjectsToCSV.ClassAnnotationProperties classProperties)
-
buildClassProperties
protected ConvertObjectsToCSV.ClassAnnotationProperties buildClassProperties(java.lang.Object data)
Method that gathers information about the data class and places the information into a ClassAnnotationProperties object.- Parameters:
data-- Returns:
- classProperties
-
workoutPropertyName
protected java.lang.String workoutPropertyName(java.lang.String methodName)
-
generateHeader
protected java.lang.String generateHeader(ConvertObjectsToCSV.ClassAnnotationProperties dataProperties)
-
-