Report Generator

@aljunggren aljunggren authored on 30 Aug 2020
src Refactored chain to iterate throught annotaion list 6 years ago
.gitignore Initial Commit 6 years ago
README.md Refactored chain to iterate throught annotaion list 6 years ago
pom.xml Removed unused dependencies 6 years ago
README.md

Report Generator

Annotate member variables that will appear on the report

@Reportable(headerName = "Name", order = 1)

Annotate reportable member variables with formatters (optional)

@DateFormatter(format = "yyyy-MM-dd")
@DecimalFormatter(format = "#.00")
@StringFormatter(format = Format.UPPERCASE)
@CurrencyFormatter(format = Currency.USD)
@BooleanFormatter(falseText = "Not Valid", trueText = "Valid")
@NullFormatter(replacementText = "No Data")
@CommaFormatter
@TrimFormatter

Instantiate and generate

new CSVGenerator(List<?> data, char delimiter).generate(); // returns CSV String
new ExcelGenerator(List<?> data).generate(); // returns POI Workbook

Date Formatter

@DateFormatter(format = "yyyy-MM-dd")

Data types supported

  • java.util.Date

Format used by java.text.SimpleDateFormat

Decimal Formatter

@DecimalFormatter(format = "#.00")

Data types supported

  • Integer
  • Double
  • Float
  • Long

Format used by java.text.DecimalFormat

String Formatter

@StringFormatter(format = Format.UPPERCASE)

Data types supported

  • String

Options

  • Format.UPPERCASE
  • Format.LOWERCASE
  • Format.CAPITALIZE
  • Format.CAPITALIZE_FULLY

Currency Formatter

@CurrencyFormatter(format = Currency.USD)

Data types supported

  • Integer
  • Double
  • Float
  • Long

Options

  • Format.USD

Boolean Formatter

@BooleanFormatter(falseText = "Not Valid", trueText = "Valid")

Arguments

  • falseText
  • trueText

Null Formatter

@NullFormatter(replacementText = "No Data")

Data ytpes supported

  • All Objects

Arguments

  • replacementText

Comma Formatter

@CommaFormatter

Data types supported

  • Integer
  • Double
  • Long

Trim Formatter

@TrimFormatter

Data types supported

  • String