Class 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.
    • Constructor Detail

      • ConvertObjectsToCSV

        public ConvertObjectsToCSV()
    • Method Detail

      • convert

        public java.lang.String convert​(java.util.List<java.lang.Object> dataList,
                                        java.lang.String prototype)
                                 throws ConversionException
        Description copied from interface: Converter
        Convert the source object by filling the prototype
        Specified by:
        convert in interface Converter<java.util.List<java.lang.Object>,​java.lang.String>
        Parameters:
        dataList - the source object
        prototype - 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: Converter
        Converts the source object, creating a new instance of the destination type
        Specified by:
        convert in interface Converter<java.util.List<java.lang.Object>,​java.lang.String>
        Specified by:
        convert in interface org.springframework.core.convert.converter.Converter<java.util.List<java.lang.Object>,​java.lang.String>
        Parameters:
        dataList - the source object
        Returns:
        the converted object
      • 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)